Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.0 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows for Workgroups **/
  3. /** Copyright (C) Microsoft Corp., 1991-1992 **/
  4. /*****************************************************************/
  5. /* npalloc.h -- Definitions for new/delete functions.
  6. *
  7. * History:
  8. * 10/06/93 gregj Created
  9. * 11/29/93 gregj Added debug instrumentation
  10. */
  11. #ifndef _INC_NPALLOC
  12. #define _INC_NPALLOC
  13. inline BOOL InitHeap(void)
  14. {
  15. return TRUE;
  16. }
  17. #ifdef DEBUG
  18. #ifndef _INC_NETLIB
  19. #include <netlib.h>
  20. #endif
  21. class MEMWATCH
  22. {
  23. private:
  24. LPCSTR _lpszLabel;
  25. MemAllocInfo _info;
  26. protected:
  27. BOOL fStats;
  28. public:
  29. MEMWATCH(LPCSTR lpszLabel);
  30. ~MEMWATCH();
  31. };
  32. class MemLeak : MEMWATCH
  33. {
  34. public:
  35. MemLeak(LPCSTR lpszLabel);
  36. ~MemLeak() {}
  37. };
  38. class MemOff
  39. {
  40. private:
  41. LPVOID pvContext;
  42. public:
  43. MemOff();
  44. ~MemOff();
  45. };
  46. #endif
  47. #ifdef DEBUG
  48. #define MEMLEAK(d,t) MemLeak d ( t )
  49. #define MEMOFF(d) MemOff d
  50. #else
  51. #define MEMLEAK(d,t)
  52. #define MEMOFF(d)
  53. #endif
  54. #endif /* _INC_NPALLOC */