Skip to main content

GC_stop_func

Type Alias GC_stop_func 

Source
pub type GC_stop_func = Option<unsafe extern "C" fn() -> c_int>;
Expand description

Trigger a full world-stopped collection. Abort the collection if and when stop_func() returns a nonzero value. stop_func() will be called frequently, and should be reasonably fast. (stop_func() is called with the allocator lock held and the world might be stopped; it is not allowed for stop_func() to manipulate pointers to the garbage-collected heap or call most of GC functions.) This works even if no virtual dirty bits, and hence incremental collection is not available for the architecture. Collections can be aborted faster than normal pause times for incremental collection; however, aborted collections do no useful work; the next collection needs to start from the beginning. stop_func must not be 0. GC_try_to_collect() returns 0 if the collection was aborted (or the collections are disabled), 1 if it succeeded.

Aliased Type§

pub enum GC_stop_func {
    None,
    Some(unsafe extern "C" fn() -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn() -> i32)

Some value of type T.