Path: utzoo!attcan!uunet!tank!ncar!ames!ucsd!rutgers!rochester!pt.cs.cmu.edu!cadre!pitt!darth!apexepa!gary From: gary@apexepa.UUCP (Gary Wisniewski) Newsgroups: comp.lang.c Subject: Re: memory allocation Summary: Don't reinvent the wheel Message-ID: <343@apexepa.UUCP> Date: 9 Sep 88 12:54:06 GMT References: <1262@micomvax.UUCP> Reply-To: gary@apexepa.UUCP (Gary Wisniewski) Distribution: comp.lang.c,comp.os.misc Organization: Apex Software Corp., Pittsburgh, Pa. Lines: 20 I doesn't sound like you have any special needs which demand an unusual allocation technique---you just need a good one. Rather than try to invent a new algorithm, why not look in Knuth's "Fundamental Algorithms" and "Sorting and Searching". There are plenty of proven techniques specifically aimed at memory management. Chances are, you'll find that a hybrid will work perfectly. I often prefer simplicity in memory allocation schemes. Usually I'll choose a first-fit or best-fit algorithm depending upon the needs of the application. It is usually pretty easy to get excellent performance. However, there are some cases where the allocation demands are severe (low memory availablity combined with high-volume allocator usage). In such cases, more complex algorithms such as Knuth's "boundary tag" algorithm can be used. I generally find such efforts not worth it except in extreme cases. -- Gary J. Wisniewski Apex Software Corporation {allegra,bellcore,cadre}!pitt!darth!apexepa!gary Phone: (412) 681-4343