Skip site navigation (1) Skip section navigation (2)

Re: DEALLOCATE ALL

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Marko Kreen" <markokr(at)gmail(dot)com>, "Neil Conway" <neilc(at)samurai(dot)com>, PGSQL-Patches <pgsql-patches(at)postgresql(dot)org>, "Andrzej Rusin" <Andrzej(dot)Rusin(at)interia(dot)pl>
Subject: Re: DEALLOCATE ALL
Date: 2007-03-30 14:00:29
Message-ID: e51f66da0703300700r7852653w662b9fb90a871b3@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
On 3/30/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> If by destruction you mean something different than pfree, then maybe
> hash_remove in a loop is the best solution, the other idea being passing
> a function pointer to hash_destroy_deep to call on each element, which
> is probably too messy an API.

Yes, callback function is needed, either in HASHCTL or as
argument to deep_free().

> In any case it's not likely that there are going to be thousands of
> prepared statements, so is this really an issue?

I think the issue is here that its very common thing to do,
so open-coding it everywhere is waste, there should be some
utility function for that.

void hash_foreach(HTAB, void (*cb_func)(void *));

-- 
marko

In response to

Responses

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2007-03-30 14:41:37
Subject: Re: DEALLOCATE ALL
Previous:From: Alvaro HerreraDate: 2007-03-30 13:44:28
Subject: Re: DEALLOCATE ALL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group