v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
free-list-inl.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_HEAP_FREE_LIST_INL_H_
6#define V8_HEAP_FREE_LIST_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
12#include "src/heap/spaces.h"
13
14namespace v8 {
15namespace internal {
16
18 return prev_ != nullptr || next_ != nullptr ||
19 owner->categories_[type_] == this;
20}
21
23 available_ -= allocation_size;
24}
25
27 FreeListCategory* category_top = top(type);
28 if (category_top != nullptr) {
29 DCHECK(!category_top->top().is_null());
30 return PageMetadata::FromHeapObject(category_top->top());
31 } else {
32 return nullptr;
33 }
34}
35
37 bool empty = true;
38 ForAllFreeListCategories([&empty](FreeListCategory* category) {
39 if (!category->is_empty()) empty = false;
40 });
41 return empty;
42}
43
44} // namespace internal
45} // namespace v8
46
47#endif // V8_HEAP_FREE_LIST_INL_H_
ThreadLocalTop * top
Tagged< FreeSpace > top()
Definition free-list.h:102
FreeListCategory * prev_
Definition free-list.h:119
bool is_linked(FreeList *owner) const
FreeListCategory * next_
Definition free-list.h:120
FreeListCategoryType type_
Definition free-list.h:110
void UpdateCountersAfterAllocation(size_t allocation_size)
FreeListCategory ** categories_
Definition free-list.h:274
PageMetadata * GetPageForCategoryType(FreeListCategoryType type)
void ForAllFreeListCategories(FreeListCategoryType type, Callback callback)
Definition free-list.h:201
static V8_INLINE PageMetadata * FromHeapObject(Tagged< HeapObject > o)
int32_t FreeListCategoryType
Definition free-list.h:37
#define DCHECK(condition)
Definition logging.h:482