File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 3030
3131namespace GC {
3232
33+ static Heap* s_the;
34+
35+ Heap& Heap::the ()
36+ {
37+ return *s_the;
38+ }
39+
3340Heap::Heap (void * private_data, AK::Function<void (HashMap<Cell*, GC::HeapRoot>&)> gather_embedder_roots)
3441 : HeapBase(private_data)
3542 , m_gather_embedder_roots(move(gather_embedder_roots))
3643{
44+ s_the = this ;
3745 static_assert (HeapBlock::min_possible_cell_size <= 32 , " Heap Cell tracking uses too much data!" );
3846 m_size_based_cell_allocators.append (make<CellAllocator>(64 ));
3947 m_size_based_cell_allocators.append (make<CellAllocator>(96 ));
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ class GC_API Heap : public HeapBase {
3838 explicit Heap (void * private_data, AK::Function<void (HashMap<Cell*, GC::HeapRoot>&)> gather_embedder_roots);
3939 ~Heap ();
4040
41+ static Heap& the ();
42+
4143 template <typename T, typename ... Args>
4244 Ref<T> allocate (Args&&... args)
4345 {
You can’t perform that action at this time.
0 commit comments