Re: patch: tsearch - some memory diet

Teodor Sigaev <teodor@sigaev.ru>

From: Teodor Sigaev <teodor@sigaev.ru>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-09-07T16:53:42Z
Lists: pgsql-hackers
> A more general solution would be to have a new MemoryContext
> implementation that does the same your patch does. Ie. instead of
> tracking each allocation, just allocate a big chunk, and have palloc()
> return the next n free bytes from it, like a stack. pfree() would
> obviously not work, but wholesale MemoryContextDelete of the whole
> memory context would.

repalloc() will not work too. Such implementation should have possibility to 
debug memory allocation/management by using some kind of red-zones or 
CLOBBER_FREED_MEMORY/MEMORY_CONTEXT_CHECKING
-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/