1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibJS: Resolve a circular include problem between HeapBlock and Cell

Cell::heap() and Cell::vm() needed to access member functions from
HeapBlock, and wanted to be inline, so they were moved to VM.h.
That approach will no longer work with VM.h not being included in every
file (starting from the next commit), so this commit fixes that circular
import issue by introducing secondary base classes to host the
references to Heap and VM, respectively.
This commit is contained in:
Ali Mohammad Pur 2023-07-09 20:05:02 +03:30 committed by Ali Mohammad Pur
parent 41f9dcd89b
commit 392b5c3b19
7 changed files with 64 additions and 25 deletions

View file

@ -39,7 +39,7 @@ static int gc_perf_string_id;
static __thread HashMap<FlatPtr*, size_t>* s_custom_ranges_for_conservative_scan = nullptr;
Heap::Heap(VM& vm)
: m_vm(vm)
: HeapBase(vm)
{
#ifdef AK_OS_SERENITY
auto gc_signpost_string = "Garbage collection"sv;