Re: Return DSA area for hash table from GetNamedDSHash()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Return DSA area for hash table from GetNamedDSHash()
Date: 2026-04-08 01:08:46
Message-ID: adWqnsjOIAWUCLLz@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haibo Yan 2026-04-08 01:21:45 Re: Extract numeric filed in JSONB more effectively
Previous Message Michael Paquier 2026-04-08 01:04:50 Re: dshash_find_or_insert vs. OOM