pub enum GcNode {
ClosureFn(Weak<NativeFn>),
EnvWrapper(Weak<Env>),
EnvBindings(Weak<EnvBindings>),
Thunk(Weak<Thunk>),
Channel {
weak: Weak<Channel>,
id: ChannelId,
},
Promise {
weak: Weak<AsyncPromise>,
id: PromiseId,
},
MultiMethod(Weak<MultiMethod>),
MutableArray(Weak<MutableArray>),
MutableCell(Weak<MutableCell>),
}Expand description
A registered cycle-birth candidate. Registered once at creation by the
(cold) constructors of the only objects that can be born into cycles;
upvalue cells and interior Value nodes are discovered during trace
(via GcEdge), never registered.
Variants§
ClosureFn(Weak<NativeFn>)
A VM closure’s NativeFn wrapper (registered by make_closure).
EnvWrapper(Weak<Env>)
An env wrapper allocation, registered on first home-adoption. The
wrapper (not just its bindings) is the candidate so a pass can reach
the whole parent chain: a cycle that closes through an ANCESTOR env’s
bindings (e.g. module code set!-ing a root binding to a closure
homed in the module) is reachable from the home wrapper via parent
edges even when no registered bindings map holds the closure.
EnvBindings(Weak<EnvBindings>)
An env’s bindings allocation (data-path registration; home adoption registers the wrapper above, which reaches the bindings anyway).
Thunk(Weak<Thunk>)
delay thunk (data-only cycles via forced).
Channel
Channel handle (data-only cycles via the runtime’s channel BUFFER, which
lives in the ChannelRegistry, reached via the runtime interior hooks).
The id is retained so a prune of a dead handle can also evict the
registry record — the handle Weak alone cannot recover it once dead.
Promise
Promise handle (data-only cycles via the runtime’s SETTLED value, which
lives in the PromiseRegistry, reached via the runtime interior hooks).
The id is retained for the same dead-handle eviction reason.
MultiMethod(Weak<MultiMethod>)
Multimethod (data-only cycles via the method table).
MutableArray(Weak<MutableArray>)
Mutable array (data-only cycles via the element vector).
MutableCell(Weak<MutableCell>)
Mutable cell (data-only cycles via the value slot).