Re: pgstat cleanup: use palloc and AllocateFile - Mailing list pgsql-patches

From Tom Lane
Subject Re: pgstat cleanup: use palloc and AllocateFile
Date
Msg-id 21029.1098894047@sss.pgh.pa.us
Whole thread Raw
In response to pgstat cleanup: use palloc and AllocateFile  (Neil Conway <neilc@samurai.com>)
Responses Re: pgstat cleanup: use palloc and AllocateFile
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> I changed more_tabstat_space() (which is invoked at various times
> indirectly throughout the backend) to allocate memory in its own private
> memory context, rather than use malloc() -- we can't just use
> CurrentMemoryContext because that may not be sufficiently long-lived.

I'd suggest just allocating the tabstat space in TopMemoryContext.  The
extra sub-context is useless overhead, since you don't actually use it
for management purposes.

            regards, tom lane

pgsql-patches by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: Updated Turkish translations
Next
From: Bruce Momjian
Date:
Subject: Re: pg_ctl -D canonicalization