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