Re: fixing dllist? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: fixing dllist?
Date
Msg-id 23088.1174520232@sss.pgh.pa.us
Whole thread Raw
In response to fixing dllist?  (Alvaro Herrera <alvherre@commandprompt.com>)
List 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 by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: relation 71478240 deleted while still in use on 8.1
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] As proposed the complete changes to pg_trigger and pg_rewrite