pub unsafe extern "C" fn mi_register_deferred_free(
out: mi_deferred_free_fun,
arg: *mut c_void,
)Expand description
Register a deferred free function.
deferred_freeAddress of a deferred free-ing function orNoneto unregister.argArgument that will be passed on to the deferred free function.
Some runtime systems use deferred free-ing, for example when using reference counting to limit the worst case free time.
Such systems can register (re-entrant) deferred free function to free more memory on demand.
-
When the
forceparameter istrueall possible memory should be freed. -
The per-thread
heartbeatparameter is monotonically increasing and guaranteed to be deterministic if the program allocates deterministically. -
The
deferred_freefunction is guaranteed to be called deterministically after some number of allocations (regardless of freeing or available free memory).
At most one deferred_free function can be active.
Note: This function is thread safe.