bmalloc: Refactored SegregatedFreeList and BoundaryTag::init
[WebKit-https.git] / Source / bmalloc / bmalloc / Deallocator.h
index 1f7e973..7caa41c 100644 (file)
 #define Deallocator_h
 
 #include "FixedVector.h"
-#include "MediumLine.h"
-#include "Sizes.h"
-#include "SmallLine.h"
-#include "XSmallLine.h"
 
 namespace bmalloc {
 
+class Heap;
+
 // Per-cache object deallocator.
 
 class Deallocator {
 public:
-    Deallocator();
+    Deallocator(Heap*);
     ~Deallocator();
 
     void deallocate(void*);
-    bool deallocateFastCase(void*);
-    void deallocateSlowCase(void*);
-
-    void deallocateXSmallLine(std::lock_guard<StaticMutex>&, XSmallLine*);
-    XSmallLine* allocateXSmallLine();
-
-    void deallocateSmallLine(std::lock_guard<StaticMutex>&, SmallLine*);
-    SmallLine* allocateSmallLine();
-
-    void deallocateMediumLine(std::lock_guard<StaticMutex>&, MediumLine*);
-    MediumLine* allocateMediumLine();
-    
     void scavenge();
     
 private:
+    bool deallocateFastCase(void*);
+    void deallocateSlowCase(void*);
+
     void deallocateLarge(void*);
     void deallocateXLarge(void*);
     void processObjectLog();
 
     FixedVector<void*, deallocatorLogCapacity> m_objectLog;
-    FixedVector<XSmallLine*, xSmallLineCacheCapacity> m_xSmallLineCache;
-    FixedVector<SmallLine*, smallLineCacheCapacity> m_smallLineCache;
-    FixedVector<MediumLine*, mediumLineCacheCapacity> m_mediumLineCache;
+    bool m_isBmallocEnabled;
 };
 
 inline bool Deallocator::deallocateFastCase(void* object)
 {
-    if (isLarge(object))
+    if (!isSmallOrMedium(object))
         return false;
 
     BASSERT(object);