Stretchy arrays (Re: Efficient coding considered harmful?)

Steven Ryan smryan at garth.UUCP
Fri Nov 4 09:29:19 AEST 1988


The problem is that allocating by some multiple badly approximates the required
size after a number of iterations.

Getting back to the original point: Make sure the basic algorithm is good.

(1) Can you never have the case where the next realloc will require more
    memory than available even though the actual size needed will fit?

(2) Can you avoid storage fragmentation so that only the current allocation
    exists and not all previous incarnations?
-- 
                                                   -- s m ryan
+--------------------------+-----------------------------------------------+
|Canada -- where American  |  The world will have peace. The question is   |
|subsidies are unfair.     |  whether people will be there to enjoy it.    |
+--------------------------+-----------------------------------------------+



More information about the Comp.lang.c mailing list