memory allocation/deallocation (malloc experts needed)

Chuck Swiger cswiger at mac.com
Thu May 20 06:29:58 PDT 2004


Till Plewe wrote:
> My problem is essentially that freeing large numbers of small chunks
> of memory can be very slow. I have run into this problem twice so far.
[ ... ]
> One solution would be to divide the memory in larger regions and to
> tell malloc which chunk to use for the next few calls, respectively when a
> whole chunk could be freed. But I don't know how to do this.

Consider using (or searching for information about) a zone-based malloc. 
NEXTSTEP used one and hence Darwin/OS X probably have sources available for 
you to consider...

-- 
-Chuck



More information about the freebsd-questions mailing list