Re: fixing dllist?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fixing dllist?
Дата
Msg-id 23088.1174520232@sss.pgh.pa.us
обсуждение исходный текст
Ответ на fixing dllist?  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Hi,
> While coding the autovacuum stuff I noticed that the dllist.c doubly
> linked list infrastructure is using malloc().  And the failure cases are
> handled in #ifdef FRONTEND exit(1) #else elog(ERROR) #endif.

> This seems a bit ugly, but more importantly, it doesn't let me free the
> whole list by simply resetting a context.  Would anybody be too upset if
> I wholesaledly changed malloc() to palloc() and get rid of the #ifdef
> FRONTEND?  AFAICS, no frontend code in our tree uses it.

IIRC, libpq once used it to manage the pending-notify list, but that was
a long time ago.  I have no objection to getting rid of the FRONTEND
support.

If you change to plain palloc you'll need to check that existing callers
call it in a suitable context --- they may be assuming that the lists
will be durable regardless of CurrentMemoryContext.
        regards, tom lane


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

Предыдущее
От: Grzegorz Jaskiewicz
Дата:
Сообщение: Re: relation 71478240 deleted while still in use on 8.1
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] As proposed the complete changes to pg_trigger and pg_rewrite