Function Macro


Declaration [src]

#define g_slice_new0 (

Description [src]

A convenience macro to allocate a block of memory from the slice allocator and set the memory to 0.

It calls g_slice_alloc0() with sizeof (type) and casts the returned pointer to a pointer of the given type, avoiding a type cast in the source code. Note that the underlying slice allocation mechanism can be changed with the [G_SLICE=always-malloc][G_SLICE] environment variable.

This can never return NULL as the minimum allocation size from sizeof (type) is 1 byte.

Available since:2.10


type -

The type to allocate, typically a structure name.