mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Use a Function to indirectly let Heap visit VM's GC roots
This allows the heap to mark cells that it needs to mark as roots without needing to directly reference the VM.
This commit is contained in:
parent
0bf2a8362a
commit
ae6d105f41
Notes:
github-actions[bot]
2024-11-14 14:39:45 +00:00
Author: https://github.com/shannonbooth
Commit: ae6d105f41
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2334
3 changed files with 10 additions and 5 deletions
|
@ -62,7 +62,9 @@ static constexpr auto make_single_ascii_character_strings(IndexSequence<code_poi
|
|||
static constexpr auto single_ascii_character_strings = make_single_ascii_character_strings(MakeIndexSequence<128>());
|
||||
|
||||
VM::VM(OwnPtr<CustomData> custom_data, ErrorMessages error_messages)
|
||||
: m_heap(*this)
|
||||
: m_heap(*this, [this](HashMap<Cell*, JS::HeapRoot>& roots) {
|
||||
gather_roots(roots);
|
||||
})
|
||||
, m_error_messages(move(error_messages))
|
||||
, m_custom_data(move(custom_data))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue