Re: fixing dllist?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fixing dllist?
Date: 2007-03-21 23:37:12
Message-ID: 23088.1174520232@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Drake 2007-03-22 00:09:22 Re: patch adding new regexp functions
Previous Message Grzegorz Jaskiewicz 2007-03-21 23:28:01 Re: relation 71478240 deleted while still in use on 8.1