Team Fortress 2 Source Code as on 22/4/2020
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.

44 lines
1019 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined(_STATIC_LINKED) || defined(_SHARED_LIB)
  14. #include "crtmemdebug.h"
  15. #ifdef USECRTMEMDEBUG
  16. #include <crtdbg.h>
  17. #endif
  18. // memdbgon must be the last include file in a .cpp file!!!
  19. #include "tier0/memdbgon.h"
  20. void CheckHeap( void )
  21. {
  22. #ifdef USECRTMEMDEBUG
  23. _CrtCheckMemory();
  24. #endif
  25. }
  26. // undone: this needs to be somehow made to construct before everything else.
  27. // see http://msdn.microsoft.com/library/periodic/period97/dembugs.htm for info
  28. void InitCRTMemDebug( void )
  29. {
  30. #ifdef USECRTMEMDEBUG
  31. _CrtSetDbgFlag(
  32. // _CRTDBG_ALLOC_MEM_DF |
  33. _CRTDBG_CHECK_ALWAYS_DF |
  34. _CRTDBG_CHECK_CRT_DF |
  35. _CRTDBG_DELAY_FREE_MEM_DF );
  36. #endif
  37. }
  38. #endif // !_STATIC_LINKED || _SHARED_LIB