Re: Return DSA area for hash table from GetNamedDSHash() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Return DSA area for hash table from GetNamedDSHash()
Date
Msg-id adWqnsjOIAWUCLLz@paquier.xyz
Whole thread Raw
In response to Return DSA area for hash table from GetNamedDSHash()  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
On Mon, Apr 06, 2026 at 05:56:21PM -0500, Sami Imseih wrote:
> Attached is a new API, dshash_get_dsa_area() that takes in a dshash_table
> and returns the area. The caller can then use dsa_set_size_limit() to limit
> the size.

+dsa_area *
+dshash_get_dsa_area(dshash_table *hash_table)
+{
+    Assert(hash_table->control->magic == DSHASH_MAGIC);
+
+    return hash_table->area;

Rather than an API that returns the DSA area, perhaps it would be more
natural to have a wrapper that calls dsa_set_size_limit(), using an
existing dshash_table in input?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: dshash_find_or_insert vs. OOM
Next
From: Haibo Yan
Date:
Subject: Re: Extract numeric filed in JSONB more effectively