Function

GLibslice_alloc0

Declaration

gpointer
g_slice_alloc0 (
  gsize block_size
)

Description

Allocates a block of memory via g_slice_alloc() and initializes the returned memory to 0. Note that the underlying slice allocation mechanism can be changed with the [G_SLICE=always-malloc][G_SLICE] environment variable.

Available since:2.10

Parameters

block_size gsize
 

The number of bytes to allocate.

Return value

Returns: gpointer
 

A pointer to the allocated block, which will be NULL if and only if mem_size is 0