Article View: comp.os.msdos.programmer
Article #6877Re: Borland C++'s "heapcheck" function
From: Charles McClellan
Date: Thu, 30 May 1991 14:08
Date: Thu, 30 May 1991 14:08
23 lines
1210 bytes
1210 bytes
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
Technical Details
Message-ID:
<1991May30.090835.9320@uwovax.uwo.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ria!uwovax.uwo.ca!35004_240References:
<0094956C.49369EA0@MAPLE.CIRCA.UFL.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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