Re: patch: tsearch - some memory diet - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: patch: tsearch - some memory diet
Date
Msg-id 4C866E16.7050604@sigaev.ru
Whole thread Raw
In response to Re: patch: tsearch - some memory diet  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List 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/
 


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: patch: tsearch - some memory diet
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: tsearch dictionary initialization hook