Commit graph

4 commits

Author SHA1 Message Date
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
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
369ed74bd1 LibGC: Add a Variant overload to Cell::Visitor
This requires the Variant to contain at least one visitable type.
For example, requiring them all to be visitable wouldn't allow types
such as `Variant<Empty, GC::Ref<Document>>`.
2026-05-15 08:51:17 +02:00
Luke Wilde
33a5f4868d LibGC: Only allow visitable types for Visitor's container helpers 2026-05-15 08:51:17 +02:00