pgsql: Add dshash_get_dsa_area(), able to retrieve the DSA area of a ds
Add dshash_get_dsa_area(), able to retrieve the DSA area of a dshash table
Code using GetNamedDSHash() to retrieve a dshash table may also want to
limit its size, but there is actually no easy way to do so because the
dsa_area of a hash table is hidden within dshash.c.
This commit adds dshash_get_dsa_area() to close the gap, which returns
the dsa_area for a given dshash_table. The DSA area retrieved can then
be passed to dsa_set_size_limit(), to limit its size. This accessor
routine also opens the door for allocating additional objects in the
same DSA area as a hash table, which may be useful for some.
Author: Sami Imseih <samimseih@gmail.com>
Discussion: /messages/by-id/CAA5RZ0tKfCVqFnMZtavM42H63ha2Haf_C4mbJNWqkaW30cPW1w@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/762e329e83f2194969a6ea859ddd08361a18ac98
Modified Files
--------------
src/backend/lib/dshash.c | 11 +++++++++++
src/include/lib/dshash.h | 1 +
2 files changed, 12 insertions(+)