Advertisement
Guest User

MLD.h

a guest
May 19th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #ifndef _MLD_H
  2. #define _MLD_H
  3.  
  4. #include <iostream>
  5. #include <fstream>
  6. #include <vector>
  7.  
  8.  
  9. struct MemLeakInfo
  10. {
  11.     unsigned int addr;
  12.     unsigned int line;
  13.     unsigned int size;
  14.     unsigned char file;
  15. };
  16.  
  17. void AddMemoryInformation(unsigned int Address, unsigned int Line, unsigned int Size, unsigned char File, std::vector<MemLeakInfo> &Vect);
  18. void RemoveMemoryInformation(unsigned int Address);
  19. void DumpInformation();
  20.  
  21.  
  22.  
  23.  
  24. #ifdef _DEBUG
  25.  
  26. void* operator new(unsigned int Size, int Line, const char* File);
  27.  
  28. void* operator new[](unsigned int Size, int Line, const char* File);
  29.  
  30.  
  31. void operator delete(void* ptr);
  32.  
  33. void operator delete[](void* ptr);
  34.  
  35. #endif //_DEBUG 1
  36.  
  37.  
  38.  
  39. #ifdef _DEBUG
  40.  
  41.     #define MY_DEBUG_NEW new( __LINE__, __FILE__)
  42.  
  43. #else
  44.  
  45.     #define MY_DEBUG_NEW new
  46.  
  47. #endif //_DEBUG 2
  48.  
  49.  
  50. #endif //_MLD_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement