pub unsafe extern "C" fn gc_register_finalizer(
obj: *mut c_void,
cd: *mut c_void,
finalizer: Option<unsafe extern "C" fn(obj: *mut c_void, cd: *mut c_void)>,
)Expand description
@brief Register a callback that gets called when the object is garbage collected. @note Objects can only have a single finalizer. This function overwrites existing values silently. @param[in] obj the object to watch @param[in] cd the data to pass to the finalizer @param[in] finalizer the callback function, called with obj and cd