Commit graph

11 commits

Author SHA1 Message Date
Luke Wilde
85fd3bb7b0 LibGC: Introduce ConservativeHashTable 2026-05-28 21:16:23 +02:00
Luke Wilde
b6219c0673 LibGC: Introduce WeakHashMap
Mirrors `WeakHashSet` for map shapes. Cell-typed key and/or value
slots are stored as `Weak<T>` so entries vanish when their referent
is collected; non-cell slots are stored directly.
2026-05-27 02:56:27 +01:00
Luke Wilde
f955d4e8a4 LibGC: Introduce ConservativeHashMap 2026-05-21 18:29:41 +02:00
Shannon Booth
a24af35ca1 LibGC: Default-construct RootHashMap from the global heap 2026-05-20 20:37:55 +02:00
Shannon Booth
78a4438cd8 LibGC: Default-construct RootHashTable from the global heap 2026-05-20 20:37:55 +02:00
Shannon Booth
de6aec04e8 LibGC: Default-construct ConservativeVector from the global heap 2026-05-20 20:37:55 +02:00
Shannon Booth
387cd6e2e2 LibGC: Default-construct RootVector from the global heap
Similar to GC::Root<T>, make GC::RootVector<T> constructible without
explicitly passing a Heap.

This is implemented by having RootVectorBase use GC::Heap::the() for
heap-free construction.
2026-05-20 20:37:55 +02:00
Shannon Booth
3897f6efb9 LibGC+Tests: Allow overriding Heap::the() for tests
Add a test-only helper for setting the default GC heap, and use it
from LibGC tests that create their own test heap.
2026-05-20 20:37:55 +02:00
Luke Wilde
d911b79ec9 LibGC: Introduce RootHashTable 2026-05-19 19:24:08 +02:00
Andreas Kling
f8b031b9fc Tests/LibGC: Keep test heaps alive until process exit
The LibGC container and visitor tests share one heap per test binary.
A function-local static heap runs its destructor during C++ static
teardown. That makes sanitizer-only results depend on process shutdown
ordering.

Use NeverDestroyed for these process-lifetime test heaps. This matches
the intended lifetime and avoids destructor-time GC work during final
LSan checking.
2026-05-15 17:02:49 +02:00
Luke Wilde
3c64e1dbbc LibGC: Add tests for GC containers 2026-05-07 13:00:52 +02:00