Function

GLibtry_malloc0_n

Declaration [src]

gpointer
g_try_malloc0_n (
  gsize n_blocks,
  gsize n_block_bytes
)

Description [src]

This function is similar to g_try_malloc0(), allocating (n_blocks * n_block_bytes) bytes, but care is taken to detect possible overflow during multiplication.

Available since:2.24

Parameters

n_blocks gsize
 

The number of blocks to allocate.

n_block_bytes gsize
 

The size of each block in bytes.

Return value

Returns: gpointer
 

The allocated memory, or NULL.