SmallLeafHeapBucket.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. namespace Memory
  6. {
  7. template <class TBlockAttributes>
  8. class SmallLeafHeapBucketT : public HeapBucketT<SmallLeafHeapBlockT<TBlockAttributes>>
  9. {
  10. typedef HeapBucketT<SmallLeafHeapBlockT<TBlockAttributes>> BaseT;
  11. protected:
  12. friend class HeapBucket;
  13. template <class TBlockAttributes>
  14. friend class HeapBucketGroup;
  15. template<bool pageheap>
  16. void Sweep(RecyclerSweep& recyclerSweep);
  17. #if DBG || defined(RECYCLER_SLOW_CHECK_ENABLED)
  18. size_t GetNonEmptyHeapBlockCount(bool checkCount) const;
  19. #endif
  20. #ifdef RECYCLER_SLOW_CHECK_ENABLED
  21. size_t Check();
  22. friend class HeapBucketT<SmallLeafHeapBlockT<TBlockAttributes>>;
  23. #endif
  24. #ifdef RECYCLER_MEMORY_VERIFY
  25. void Verify();
  26. #endif
  27. #ifdef RECYCLER_VERIFY_MARK
  28. void VerifyMark();
  29. #endif
  30. #ifdef ENABLE_DEBUG_CONFIG_OPTIONS
  31. friend class ScriptMemoryDumper;
  32. #endif
  33. };
  34. typedef SmallLeafHeapBucketT<SmallAllocationBlockAttributes> SmallLeafHeapBucket;
  35. typedef SmallLeafHeapBucketT<MediumAllocationBlockAttributes> MediumLeafHeapBucket;
  36. }