Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ria!uwovax.uwo.ca!35004_240 From: 35004_240@uwovax.uwo.ca (Charles McClellan) Newsgroups: comp.os.msdos.programmer Subject: Re: Borland C++'s "heapcheck" function Message-ID: <1991May30.090835.9320@uwovax.uwo.ca> Date: 30 May 91 14:08:35 GMT References: <0094956C.49369EA0@MAPLE.CIRCA.UFL.EDU> Lines: 23 I have used all of these functions in a memory checking package. The header for this package redefines malloc, free, etc to my own versions. Then I call heapcheck, and heapcheckfree before allocating any memory and heapcheckfill after freeing any memory. These functions will basically catch most cases where you continue to use a pointer after freeing it. Heapfillfree and heapcheckfree will also catch memory overwrites of the heap. I also allocate an extra word before and after each block in which I store the size of the block. This lets me catch most overwrites of the block. I have found these functions quite useful. -- Charles McClellan: SLIS Elborn College University of Western Ontario London, Ont. Canada Tel: 519-661-3542 ext. 8485 C.McClellan@uwovax.uwo.ca