Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cwlim!trier From: trier@cwlim.INS.CWRU.Edu (Stephen C. Trier) Newsgroups: comp.os.msdos.programmer Subject: Re: Does TC's farrealloc have a bug? Keywords: farrealloc,realloc,memory Message-ID: <1991Jun29.025008.20088@usenet.ins.cwru.edu> Date: 29 Jun 91 02:50:08 GMT References: <1991Jun19.083945.8921@ucthpx.uct.ac.za> <1991Jun20.074613.1279@donau.et.tudelft.nl> <2643@wet.UUCP> Sender: news@usenet.ins.cwru.edu Reply-To: trier@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 19 Nntp-Posting-Host: cwlim.ins.cwru.edu If you are interested in seeing how a real malloc implementation works, I recommend _The C Programming Language_, by Kernighan and Ritchie. The authors illustrate memory allocation with "malloc" and "free" functions which could very well be from a C library. They also explain the mechanisms of the memory allocator quite thoroughly. Incidentally, the first edition of K&R called the function "alloc". The second edition, without changing the code itself, admits that the function is "malloc". Most malloc implementations are similar to the version in K&R. They may have additional optimizations, but the principles are the same. -- Stephen Trier "48 61 70 70 69 6e 65 73 73 20 69 73 20 61 Server Surgery Group 20 77 61 72 6d 20 68 65 78 20 64 75 6d 70 Information Network Services 21 20 20 3b 2d 29" - Me Case Western Reserve University Mail: trier@ins.cwru.edu