mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibGC: Add GC::RootHashMap<...> template container
This is a GC-aware wrapper around AK::HashMap. Entry values are treated as GC roots, much like the GC::RootVector we already had. We also provide GC::OrderedRootHashMap as a convenience.
This commit is contained in:
parent
a453da2906
commit
11ece7de10
Notes:
github-actions[bot]
2025-05-03 15:34:58 +00:00
Author: https://github.com/awesomekling
Commit: 11ece7de10
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4573
6 changed files with 122 additions and 0 deletions
|
@ -282,6 +282,9 @@ void Heap::gather_roots(HashMap<Cell*, HeapRoot>& roots)
|
|||
for (auto& vector : m_root_vectors)
|
||||
vector.gather_roots(roots);
|
||||
|
||||
for (auto& hash_map : m_root_hash_maps)
|
||||
hash_map.gather_roots(roots);
|
||||
|
||||
if constexpr (HEAP_DEBUG) {
|
||||
dbgln("gather_roots:");
|
||||
for (auto* root : roots.keys())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue