Expand description
GcRef<T> — the GC-managed reference handle.
Newtype around lua_gc::Gc<T> — Copy under the hood, tracks allocation
in the active Heap (via lua_gc::with_current_heap(...)). An earlier
revision was a thin Rc<T> newtype instead; the surface stayed stable
across the swap (new, ptr_eq, identity, strong_count,
weak_count, downgrade), and existing code touching gc.0 continues
to work — .0 is now Gc<T> instead of Rc<T>.
§Weak refs
Heap-tracked GcWeak<T> handles remember the heap active when they were
created plus the target’s heap allocation token. They upgrade only while
that identity/token pair remains live. Handles to legacy uncollected boxes
still upgrade forever, matching their process-lifetime allocation model.