From: | Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: plpgsql versus domains |
Date: | 2015-03-01 06:55:55 |
Message-ID: | 87sidp43s7.fsf@news-spur.riddles.org.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
Tom> This is the first attempt at weaponizing the memory context
Tom> reset/delete feature, and I'm fairly happy with it, except for one
Tom> thing: I had to #include utils/memnodes.h into typcache.h in order
Tom> to preserve the intended property that the callback structs could
Tom> be included directly into structs using them. Now, that's not
Tom> awful in itself, because typcache.h isn't used everywhere; but if
Tom> this feature gets popular we'll find memnodes.h being included
Tom> pretty much everywhere, which is not so great. I'm thinking about
Tom> moving struct MemoryContextCallback and the extern for
Tom> MemoryContextRegisterResetCallback into palloc.h to avoid this.
Tom> Maybe that's too far in the other direction. Thoughts?
Tom> Compromise ideas?
This was pretty much my first thought on looking at the callback
patch. It may seem logical to put the reset callback stuff in
memutils/memnodes alongside context creation and reset and so on, but in
fact the places that are going to want to use callbacks are primarily
_not_ the places that are doing their own context management - since
those could do their own cleanup - but rather places that are allocating
things in contexts supplied by others. So palloc.h is the place for it.
--
Andrew (irc:RhodiumToad)
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Jelinek | 2015-03-01 10:03:11 | Re: mogrify and indent features for jsonb |
Previous Message | Tom Lane | 2015-03-01 06:39:09 | Re: rm static libraries before rebuilding |