hash_destroy on the hash table allocated with TopMemoryContext

From: Sharique Muhammed <shq78758(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: hash_destroy on the hash table allocated with TopMemoryContext
Date: 2024-04-17 07:34:18
Message-ID: CAN9TmwsS6j2QU5Kqji+uzG0q_-yDoN2KVY14qedCvE=Z6F9wiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was looking for a pattern to destroy a hashtable (dynahash).allocated
in TopMemoryContext
I found one pattern : create_seq_hashtable uses TopMemoryContext
memory context to create hash table. It calls hash_destroy in
ResetSequenceCaches. hash_destroy will destroy the memory
context(TopMemoryContext). Is it the right way to use hash_destroy ?

I have allocated a hash table in TopMemoryContext context and I want
to destroy it. It seems to me that there is no function to destroy hash
table allocated in TopMemoryContext context.

-- Sharique

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-04-17 07:40:02 Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Previous Message Masahiko Sawada 2024-04-17 07:30:31 Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)