X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/heap/GCSegmentedArray.h?ds=inline diff --git a/heap/GCSegmentedArray.h b/heap/GCSegmentedArray.h index 8faf16b..8aeba10 100644 --- a/heap/GCSegmentedArray.h +++ b/heap/GCSegmentedArray.h @@ -26,26 +26,25 @@ #ifndef GCSegmentedArray_h #define GCSegmentedArray_h -#include "HeapBlock.h" +#include #include namespace JSC { -class BlockAllocator; -class DeadBlock; - template -class GCArraySegment : public HeapBlock> { +class GCArraySegment : public DoublyLinkedListNode> { + friend class WTF::DoublyLinkedListNode>; public: - GCArraySegment(Region* region) - : HeapBlock(region) + GCArraySegment() + : DoublyLinkedListNode>() #if !ASSERT_DISABLED , m_top(0) #endif { } - static GCArraySegment* create(DeadBlock*); + static GCArraySegment* create(); + static void destroy(GCArraySegment*); T* data() { @@ -54,6 +53,8 @@ public: static const size_t blockSize = 4 * KB; + GCArraySegment* m_prev; + GCArraySegment* m_next; #if !ASSERT_DISABLED size_t m_top; #endif @@ -66,7 +67,7 @@ class GCSegmentedArray { friend class GCSegmentedArrayIterator; friend class GCSegmentedArrayIterator; public: - GCSegmentedArray(BlockAllocator&); + GCSegmentedArray(); ~GCSegmentedArray(); void append(T); @@ -101,7 +102,6 @@ protected: void validatePrevious(); DoublyLinkedList> m_segments; - BlockAllocator& m_blockAllocator; JS_EXPORT_PRIVATE static const size_t s_segmentCapacity = CapacityFromSize::blockSize>::value; size_t m_top;