dlrealloc

Function dlrealloc 

Source
pub unsafe extern "C" fn dlrealloc(
    p: *mut c_void,
    n: usize,
) -> *mut c_void
Expand description

realloc(void* p, size_t n)

Returns a pointer to a chunk of size n that contains the same data as does chunk p up to the minimum of (n, p’s size) bytes, or null if no space is available.

The returned pointer may or may not be the same as p. The algorithm prefers extending p in most cases when possible, otherwise it employs the equivalent of a malloc-copy-free sequence.

If p is null, realloc is equivalent to malloc.

If space is not available, realloc returns null, errno is set (if on ANSI) and p is NOT freed.

if n is for fewer bytes than already held by p, the newly unused space is lopped off and freed if possible. realloc with a size argument of zero (re)allocates a minimum-sized chunk.

Note that the return new pointer does not guarantee the same alignment to the old pointer!

The old unix realloc convention of allowing the last-free’d chunk to be used as an argument to realloc is not supported.