%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_HEAP_CPPGC_FREE_LIST_H_ #define V8_HEAP_CPPGC_FREE_LIST_H_ #include <array> #include "include/cppgc/heap-statistics.h" #include "src/base/macros.h" #include "src/heap/cppgc/globals.h" #include "src/heap/cppgc/heap-object-header.h" namespace cppgc { namespace internal { class V8_EXPORT_PRIVATE FreeList { public: struct Block { void* address; size_t size; }; FreeList(); FreeList(const FreeList&) = delete; FreeList& operator=(const FreeList&) = delete; FreeList(FreeList&& freelist) V8_NOEXCEPT; FreeList& operator=(FreeList&& freelist) V8_NOEXCEPT; // Allocates entries which are at least of the provided size. Block Allocate(size_t); // Adds block to the freelist. The minimal block size is two words. // Returns the start of the free list payload that will not be accessed by // the free list itself. Address Add(Block); // Append other freelist into this. void Append(FreeList&&); void Clear(); size_t Size() const; bool IsEmpty() const; void CollectStatistics(HeapStatistics::FreeListStatistics&); bool ContainsForTesting(Block) const; private: class Entry; bool IsConsistent(size_t) const; // All |Entry|s in the nth list have size >= 2^n. std::array<Entry*, kPageSizeLog2> free_list_heads_; std::array<Entry*, kPageSizeLog2> free_list_tails_; size_t biggest_free_list_index_ = 0; }; } // namespace internal } // namespace cppgc #endif // V8_HEAP_CPPGC_FREE_LIST_H_