Counter Strike : Global Offensive Source Code
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.

36 lines
868 B

  1. //========= Copyright � 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Spew free memory at a fixed rate, for logging
  4. //
  5. //=============================================================================//
  6. #ifndef C_MEMORYLOG_H
  7. #define C_MEMORYLOG_H
  8. #if defined( _GAMECONSOLE ) && !defined( _CERT )
  9. #define C_MEMORYLOG_TICKING_ENABLED
  10. #endif
  11. #ifdef C_MEMORYLOG_TICKING_ENABLED
  12. #include "igamesystem.h"
  13. class C_MemoryLog : public CAutoGameSystemPerFrame
  14. {
  15. public:
  16. // Methods of IGameSystem
  17. virtual bool Init( void );
  18. virtual void Update( float frametime );
  19. virtual void LevelInitPostEntity();
  20. virtual void LevelShutdownPreEntity();
  21. private:
  22. void Spew( void );
  23. float m_fLastSpewTime;
  24. size_t m_nRecentFreeMem[ 256 ]; // For inspection in full heap crashdumps
  25. };
  26. #endif // C_MEMORYLOG_TICKING_ENABLED
  27. #endif // C_MEMORYLOG_H