Function mun_runtime::gc::mun_gc_unroot

source ·
#[no_mangle]
pub unsafe extern "C" fn mun_gc_unroot(
    runtime: Runtime,
    obj: GcPtr
) -> ErrorHandle
Expand description

Unroots the specified obj, potentially allowing it and objects it references to be collected. An object can be rooted multiple times, so you must make sure to call mun_gc_unroot the same number of times as mun_gc_root was called before the object can be collected. If successful, obj has been unrooted, otherwise a non-zero error handle is returned.

If a non-zero error handle is returned, it must be manually destructed using [mun_error_destroy].

Safety

This function receives raw pointers as parameters. If any of the arguments is a null pointer, an error will be returned. Passing pointers to invalid data, will lead to undefined behavior.