HeapBucketStats.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #include "CommonDefines.h"
  7. namespace Memory
  8. {
  9. #if ENABLE_MEM_STATS
  10. struct MemStats
  11. {
  12. size_t objectByteCount;
  13. size_t totalByteCount;
  14. MemStats();
  15. void Reset();
  16. size_t FreeBytes() const;
  17. double UsedRatio() const;
  18. void Aggregate(const MemStats& other);
  19. };
  20. struct HeapBucketStats : MemStats
  21. {
  22. #ifdef DUMP_FRAGMENTATION_STATS
  23. uint totalBlockCount;
  24. uint objectCount;
  25. uint finalizeCount;
  26. HeapBucketStats();
  27. void Reset();
  28. void Dump() const;
  29. #endif
  30. void PreAggregate();
  31. void BeginAggregate();
  32. void Aggregate(const HeapBucketStats& other);
  33. };
  34. #endif
  35. }