jam 0.0.1
A compacting generational garbage collector for C++26
Loading...
Searching...
No Matches
jam::weak< V > Class Template Referenceexport
Word heap | module jam

An external conditional weak-value handle; registration survives dropped handles.Keep this handle outside the managed heap. Copies share one registration. Finalization expires all copies before the callback runs; resurrection does not rearm it. More...

Public Member Functions

bool expired () const noexcept
 Whether the registration has retired or its heap has been destroyed.
root< V > lock () const noexcept
 Retain the current value, or return an empty root for a retired registration. Locking and using the returned root require the owning heap current.
void finalize () const noexcept
 Retire the registration and run its callback now, at most once. Requires the owning heap current. Also drains finalizers scheduled by nested collection.

Detailed Description

template<class V>
class jam::weak< V >

An external conditional weak-value handle; registration survives dropped handles.

Keep this handle outside the managed heap. Copies share one registration. Finalization expires all copies before the callback runs; resurrection does not rearm it.

Definition at line 2399 of file heap.ccm.


The documentation for this class was generated from the following file: