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 <[email protected]>
Discussion: 
https://postgr.es/m/caa5rz0tkfcvqfnmztavm42h63ha2haf_c4mbjnwqkaw30cp...@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(+)

Reply via email to