Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.c Subject: Re: Stretchy arrays (Re: Efficient coding considered harmful?) Message-ID: <1738@garth.UUCP> Date: 3 Nov 88 23:29:19 GMT References: <1709@garth.UUCP> <956@goofy.megatest.UUCP> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 17 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. | +--------------------------+-----------------------------------------------+