Skip to main content

GC_set_stackbottom

Function GC_set_stackbottom 

Source
pub unsafe extern "C" fn GC_set_stackbottom(
    arg1: *mut c_void,
    arg2: *const GC_stack_base,
)
Expand description

Set the cool end of the user (coroutine) stack of the specified thread. The GC thread handle (gc_thread_handle) is either the one returned by GC_get_my_stackbottom() or NULL (the latter designates the current thread). The caller should hold the allocator lock (e.g. using GC_call_with_reader_lock() with release argument set to 1), the reader mode should be enough typically, at least for the collector itself (the client is responsible to avoid data race between this and GC_get_my_stackbottom functions if the client acquires the allocator lock in the reader mode). Also, the function could be used for setting GC_stackbottom value (the bottom of the primordial thread) before the collector is initialized (the allocator lock is not needed to be acquired at all in this case).