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.

29 lines
784 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: leakchk.h
  8. //
  9. //--------------------------------------------------------------------------
  10. //
  11. // leakchk.h: simple macros to aid in checking for memory leaks in base classes
  12. //
  13. #ifndef _LEAKCHK_H_
  14. #define _LEAKCHK_H_
  15. #ifdef _DEBUG
  16. #define LEAK_VAR_DECL static int _cNew;
  17. #define LEAK_VAR_UPD(i) { _cNew += i; }
  18. #define LEAK_VAR_DEF(CLS) int CLS::_cNew = 0;
  19. #define LEAK_VAR_ACCESSOR static int CNew () { return _cNew; }
  20. #else
  21. #define LEAK_VAR_DECL
  22. #define LEAK_VAR_UPD(i)
  23. #define LEAK_VAR_DEF(CLS)
  24. #define LEAK_VAR_ACCESSOR static int CNew () { return -1; }
  25. #endif
  26. #endif // _LEAKCHK_H_