base/zz_allocmap.h

Go to the documentation of this file.
00001 /* libzz
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_allocmap_h
00010 #define zz_allocmap_h
00011 
00012 #include "zz_export.h"
00013 
00014 #ifdef _WIN32
00015         // Debugsymbols longer than 255 chars
00016         #pragma warning(disable: 4786) 
00017         #pragma warning(disable: 4251)
00018         #include "windows.h"
00019 #endif
00020 
00021 #include <stddef.h>
00022 #include <malloc.h>
00023 #include <memory.h>
00024 #include <map>
00025 
00026 using namespace std;
00027 
00029 #define ZZ_MSG_MEMLEAKS "WARNING, Memory leaks detected!\n"
00030 
00038 class ZZ_API CzzAllocMap
00039 {
00040 public:
00041 
00047         CzzAllocMap();
00048 
00049         ~CzzAllocMap();
00050 
00056         int CheckMemory( void );
00057 
00062         void Delete( int addr );
00069         void Add( int addr,     void* p, size_t n );
00070 
00071 private:
00072 
00073         map<int, void* > m_AllocMap;
00074         map<int, size_t > m_SizeMap;
00075         map<int, void* >::iterator m_Iterator;
00076 };
00077 
00078 #endif
00079 

Generated on Thu Sep 21 21:45:41 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO