Skip to main content

free_value

Function free_value 

Source
pub unsafe fn free_value(payload: *mut ())
Expand description

Reclaim a value box, dropping the engine value it held.

This is __JS_FreeValue once the count reaches zero, and therefore the moment a host class’s finalizer runs (see ClassDef in the engine). It is the seam NFR-4’s “deterministic release” rests on: without it, a script’s garbage would be freed by Rust at some unrelated later point.

§Safety

payload must be a live payload from box_value whose count has reached zero, and must not be used again.