Skip to main content

GC_toggleref_add

Function GC_toggleref_add 

Source
pub unsafe extern "C" fn GC_toggleref_add(
    arg1: *mut c_void,
    arg2: c_int,
) -> c_int
Expand description

Register a given object for “toggle-refs” processing. It will be stored internally and the “toggle-refs” callback will be invoked on the object until the callback returns GC_TOGGLE_REF_DROP or the object is collected. If is_strong, then the object is registered with a strong ref, a weak one otherwise. obj should be the starting address of an object allocated by GC_malloc (GC_debug_malloc) or friends. Returns GC_SUCCESS if registration succeeded (or no callback is registered yet), GC_NO_MEMORY if it failed for a lack of memory reason.