1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07: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

@ -32,7 +32,7 @@ NonnullOwnPtr<HeapBlock> HeapBlock::create_with_cell_size(Heap& heap, size_t cel
}
HeapBlock::HeapBlock(Heap& heap, size_t cell_size)
: m_heap(heap)
: HeapBlockBase(heap)
, m_cell_size(cell_size)
{
VERIFY(cell_size >= sizeof(FreelistEntry));