Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!motcid!dyer From: dyer@cell.mot.COM (Bill Dyer) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft C 5.1 memory fragmentation problem Message-ID: <705@mica2.UUCP> Date: 9 Jan 90 15:44:15 GMT References: <1990Jan1.211844.10550@ns.network.com> Organization: Motorola Inc. - Cellular Infrastructure Div., Arlington Heights, IL 60004 Lines: 24 In article <1990Jan1.211844.10550@ns.network.com> ddb@network.com (David Dyer-Bennet) writes: >I'm sure I remember seeing references to this problem in various >places: when I do a LOT of malloc and free using the library routines >from Microsoft, I get my heap mongo fragmented, because they don't >merge adjacent free space. (This is obviously a bug, but never mind >that now....) I vaguely remember that Microsoft has published some >code to do this merging, that one can put into a program and call when >needed. Can anybody give me a pointer to code to merge adjacent free >space in the Microsoft heap, or code for a whole new malloc that will >work in the Microsoft C environment? Anon ftp location would be fine, >or mail it to me maybe if it's small. > >Thanks! There is a book called Advanced C Tips and Techniques that has a whole chapter dedicated to the development of a heap manager. It includes the complete source listing. The complete reference is: Advanced C - Tips and Techniques Paul Anderson and Gail Anderson Stephen G. Kochan and Patrick H. Wood eds. Hayden Books, Indianapolis, Indiana This is also a great book on C in general. Hope this helps.