SmallLeafHeapBucket.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. void Sweep(RecyclerSweep& recyclerSweep);
  16. #if DBG || defined(RECYCLER_SLOW_CHECK_ENABLED)
  17. size_t GetNonEmptyHeapBlockCount(bool checkCount) const;
  18. #endif
  19. #ifdef RECYCLER_SLOW_CHECK_ENABLED
  20. size_t Check();
  21. friend class HeapBucketT<SmallLeafHeapBlockT<TBlockAttributes>>;
  22. #endif
  23. #ifdef RECYCLER_MEMORY_VERIFY
  24. void Verify();
  25. #endif
  26. #ifdef RECYCLER_VERIFY_MARK
  27. void VerifyMark();
  28. #endif
  29. #ifdef ENABLE_DEBUG_CONFIG_OPTIONS
  30. friend class ::ScriptMemoryDumper;
  31. #endif
  32. };
  33. typedef SmallLeafHeapBucketT<SmallAllocationBlockAttributes> SmallLeafHeapBucket;
  34. typedef SmallLeafHeapBucketT<MediumAllocationBlockAttributes> MediumLeafHeapBucket;
  35. }