pub type OutOfMemoryCallback = Option<unsafe extern "C" fn(*mut JSContext, *mut c_void)>;Expand description
Unlike the error reporter, which is only called if the exception for an OOM bubbles up and is not caught, the OutOfMemoryCallback is called immediately at the OOM site to allow the embedding to capture the current state of heap allocation before anything is freed. If the large-allocation-failure callback is called at all (not all allocation sites call the large-allocation-failure callback on failure), it is called before the out-of-memory callback; the out-of-memory callback is only called if the allocation still fails after the large-allocation-failure callback has returned.
Aliased Type§
pub enum OutOfMemoryCallback {
None,
Some(unsafe extern "C" fn(*mut JSContext, *mut c_void)),
}Variants§
None
No value.
Some(unsafe extern "C" fn(*mut JSContext, *mut c_void))
Some value of type T.
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.