pub unsafe extern "C" fn aws_mem_realloc(
allocator: *mut aws_allocator,
ptr: *mut *mut c_void,
oldsize: usize,
newsize: usize
) -> c_int
Expand description
Attempts to adjust the size of the pointed-to memory buffer from oldsize to newsize. The pointer (*ptr) may be changed if the memory needs to be reallocated.
In versions v0.6.8 and prior, this function was allowed to return NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a GC etc…before returning.