  | 
   Using CrtCheckMemory() 
   Submitted by  |   
  
  
Lately I had to debug code that caused heap corruption, I found myself
struggling against the computer in order to understand what causes the
corruption and how.
  In the search for memory validation APIs I have found _CrtCheckMemory() API
which is being used by debug version of C run-time libraries.
 
Using this API wrapped with an assert macro gives us the opportunity to
check the heap every few lines of code without any overhead in release
version:
 
_ASSERTE( CrtCheckMemory());
 
it would be smart idea to use it even without any visible corruption, it
saves time in the long run :-)
 
 
This tip is based on information written on the MSDN.
 
Nir Dremer 
Pixel Software Technologies
 | 
 
 
 
The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.
 
 
 |