try_malloc
Description:
public void*
try_malloc (
size_t n_bytes)
Attempts to allocate n_bytes
, and returns null on failure.
Contrast with malloc, which aborts the program on failure.
Parameters:
n_bytes |
number of bytes to allocate.
|
Returns:
the allocated memory, or null.
|