try_realloc


Description:

public void* try_realloc (void* mem, size_t n_bytes)

Attempts to realloc mem to a new size, n_bytes, and returns null on failure.

Contrast with realloc, which aborts the program on failure.

If mem is null, behaves the same as try_malloc.

Parameters:

mem

previously-allocated memory, or null.

n_bytes

number of bytes to allocate.

Returns:

the allocated memory, or null.


Namespace: GLib
Package: glib-2.0