Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more/diag/checkmem.h

Go to the documentation of this file.
00001 
00002 // NOTE!  This file shall be included _only_ in the translation unit which
00003 // defines main to check the allocations in test programs.  Still this does
00004 // not always work, but you typically get an idea if there is a memory leak
00005 // in new/delete.  BETTER:  Use MORE_NEW and MORE_DELETE from more/debug.h
00006 // explicitely for the part of the program to check.
00007 
00008 #ifndef MORE_CHECKMEM_H
00009 #define MORE_CHECKMEM_H
00010 
00011 #include <more/diag/debug.h>
00012 
00013 inline void* operator new(std::size_t sz) throw(std::bad_alloc) {
00014     return more::diag::checkmem::alloc(sz);
00015 }
00016 
00017 inline void operator delete(void* ptr) throw() {
00018     more::diag::checkmem::free(ptr);
00019 }
00020 
00021 #endif

Generated on Sat Sep 7 19:11:10 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.