Skip to main content

GC_malloc_ignore_off_page

Function GC_malloc_ignore_off_page 

Source
pub unsafe extern "C" fn GC_malloc_ignore_off_page(
    arg1: usize,
) -> *mut c_void
Expand description

Allocate an object of size lb bytes. The client guarantees that as long as the object is live, it will be referenced by a pointer that points to somewhere within the first GC heap block (hblk) of the object. (This should normally be declared volatile to prevent the compiler from invalidating this assertion.) This function is only useful if a large array is being allocated. It reduces the chance of accidentally retaining such an array as a result of scanning an integer that happens to be an address inside the array. (Actually, it reduces the chance of the allocator not finding space for such an array, since it will try hard to avoid introducing such a false reference.) On a SunOS 4.x or Windows system this is recommended for arrays likely to be larger than 100 KB or so. For other systems, or if the collector is not configured to recognize all interior pointers, the threshold is normally much higher. These functions are guaranteed never to return NULL unless GC_oom_fn() returns NULL.