Memory Allocation (was Re: binary data files)

Tom Stockfisch tps at chem.ucsd.edu
Thu May 4 18:04:03 AEST 1989


In article <10202 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <1989May3.201118.10221 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>>In article <17252 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>>>I get the feeling that some future BSD will have six different malloc
>>>library routines. . . .
>>It would be too much to ask for one *good* one!  :-) :-(

>Most applications that really care about malloc() efficiency have already
>given up and implemented their own technique, using malloc() simply as an
>sbrk() surrogate.

The problem is that a power-of-2 malloc()/realloc() cannot be
regarded as an sbrk() surrogate when considering the
problem of constructing a potentially
long object whose size is it not known until
you are done constructing it.

You waste up to a factor of 4 with a power-of-2 implementation,
not including fragmentation.

-- 

|| Tom Stockfisch, UCSD Chemistry	tps at chem.ucsd.edu



More information about the Comp.lang.c mailing list