tryRealloc

Attempts to realloc mem to a new size, n_bytes, and returns null on failure. Contrast with glib.global.realloc, which aborts the program on failure.

If mem is null, behaves the same as glib.global.tryMalloc.

void*
tryRealloc
(
void* mem
,
size_t nBytes
)

Parameters

mem void*

previously-allocated memory, or null.

nBytes size_t

number of bytes to allocate.

Return Value

Type: void*

the allocated memory, or null.