Memory Allocation

Peter Desnoyers desnoyer at Apple.COM
Fri May 12 03:02:58 AEST 1989


In article <4132 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>I have one question about all this... why this need to store the whole of
>some randomly-sized chunk of data in a contiguous block of memory? Why not
>use something like clists?
>-- 
>Peter da Silva, Xenix Support, Ferranti International Controls Corporation.

Because for a simple program (read it in, crunch it, write it out) you
can use an allocation scheme that is so simple that it will work the
first time. Also, for some data sets the "natural" representation is a
contiguous array, rather than linked chunks, and your processing code
becomes more complicated when you use a more sophisticated allocation
method. In other words, it's a kludge. Unlike many kludges, however,
the payoff is in robustness and simplicity.

				Peter Desnoyers



More information about the Comp.lang.c mailing list