ladybird/Libraries/LibGC
Andreas Kling 25a5ed94d6 LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T>
This is a weak pointer that integrates with the garbage collector.
It has a number of differences compared to AK::WeakPtr, including:

- The "control block" is allocated from a well-packed WeakBlock owned by
  the GC heap, not just a generic malloc allocation.

- Pointers to dead cells are nulled out by the garbage collector
  immediately before running destructors.

- It works on any GC::Cell derived type, meaning you don't have to
  inherit from AK::Weakable for the ability to be weakly referenced.

- The Weak always points to a control block, even when "null" (it then
  points to a null WeakImpl), which means one less null check when
  chasing pointers.
2025-10-17 17:22:16 +02:00
..
BlockAllocator.cpp LibGC: Pass correct args to VirtualFree 2025-06-05 22:00:55 -06:00
BlockAllocator.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
Cell.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Cell.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
CellAllocator.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
CellAllocator.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
CMakeLists.txt LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
ConservativeVector.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ConservativeVector.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
DeferGC.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
ForeignCell.cpp LibGC: Add a ForeignCell class for ownership of non-C++ objects 2024-11-19 14:32:11 -07:00
ForeignCell.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
Forward.h LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
Function.h LibGC: Mark GC::Function and create_function as ESCAPING 2024-12-10 07:13:00 +01:00
Heap+Swift.swift LibGC: Teach Swift bindings about Cell and Cell::Visitor 2025-04-03 16:47:48 -06:00
Heap.cpp LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
Heap.h LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
HeapBlock.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
HeapBlock.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
HeapRoot.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
Internals.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
NanBoxedValue.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
Ptr.h LibGC: Mark Ptr::as_nonnull as a const function 2025-10-08 17:25:29 +02:00
Root.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Root.h LibGC: Make GC::Root bool operator explicit 2025-08-21 12:50:43 -04:00
RootHashMap.cpp LibGC: Add GC::RootHashMap<...> template container 2025-05-03 17:33:54 +02:00
RootHashMap.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
RootVector.cpp LibGC: Allow move-assigning RootVector instances 2025-04-19 02:03:43 +02:00
RootVector.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
Weak.h LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
WeakBlock.cpp LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
WeakBlock.h LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00
WeakContainer.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
WeakContainer.h LibGC: Enable EXPLICIT_SYMBOL_EXPORT 2025-06-30 10:50:36 -06:00
WeakInlines.h LibGC: Add GC::Weak<T> as an alternative to AK::WeakPtr<T> 2025-10-17 17:22:16 +02:00