Re: pgstat cleanup: use palloc and AllocateFile

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pgstat cleanup: use palloc and AllocateFile
Date: 2004-10-27 16:20:47
Message-ID: 21029.1098894047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-10-27 17:16:33 Re: pg_ctl -D canonicalization
Previous Message Tom Lane 2004-10-27 16:00:35 Re: rmtree() failure on Windows