00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef zz_allocmap_h
00010 #define zz_allocmap_h
00011
00012 #include "zz_export.h"
00013
00014 #ifdef _WIN32
00015
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