Memory.tryRealloc

Attempts to realloc mem to a new size, n_bytes, and returns NULL on failure. Contrast with g_realloc(), which aborts the program on failure.

If mem is NULL, behaves the same as g_try_malloc().

struct Memory
static
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.