tryMalloc

Attempts to allocate n_bytes, and returns null on failure. Contrast with glib.global.gmalloc, which aborts the program on failure.

void*
tryMalloc
(
size_t nBytes
)

Parameters

nBytes size_t

number of bytes to allocate.

Return Value

Type: void*

the allocated memory, or null.