Skip to main content

scan_v51_finalizable_userdata

Function scan_v51_finalizable_userdata 

Source
pub fn scan_v51_finalizable_userdata(state: &mut LuaState)
Expand description

Lua 5.1 collect-time finalizability scan, run before an explicit collect.

Mirrors C 5.1 luaC_separateudata: walk every rostered userdata and, for each one whose live metatable now carries __gc, register it for finalization. register_finalizable_object is idempotent (it skips already-finalized objects), so a userdata registered eagerly at setmetatable or by an earlier scan is not double-registered. Reachability is decided later by the collector’s post-mark hook: a still-reachable userdata stays pending and is finalized only once it actually dies.

No-op on 5.2–5.5.