Re: MemoryContext reset/delete callbacks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MemoryContext reset/delete callbacks
Дата
Msg-id 20196.1425075721@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MemoryContext reset/delete callbacks  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2015-02-26 19:28:50 -0500, Tom Lane wrote:
>> 1. I used ilists for the linked list of callback requests.  This creates a
>> dependency from memory contexts to lib/ilist.  That's all right at the
>> moment since lib/ilist does no memory allocation, but it might be
>> logically problematic.  We could just use explicit "struct foo *" links
>> with little if any notational penalty, so I wonder if that would be
>> better.

> Maybe I'm partial here, but I don't see a problem. Actually the reason I
> started the ilist stuff was that I wrote a different memory context
> implementation ;). Wish I'd time/energy to go back to that...

After further reflection, I concluded that it was better to go with the
low-tech "struct foo *next" approach.  Aside from the question of whether
we really want mcxt.c to have any more dependencies than it already does,
there's the stylistic point that mcxt.c is already managing lists (of
child contexts) that way; it would be odd to have two different list
technologies in use in the one data structure.

You could of course argue that both of these should be changed to slists,
but that would be a matter for a separate patch.  (And frankly, I'm not
so in love with the slist notation that I'd think it an improvement.)

I also rearranged the bool fields as you suggested to avoid wasted padding
space.  I'm still not exactly convinced that it's worth the ugliness, but
it's not worth arguing about.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Arthur Silva
Дата:
Сообщение: Re: logical column ordering
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: deparsing utility commands