Function

GLibatomic_rc_box_alloc0

Declaration

gpointer
g_atomic_rc_box_alloc0 (
  gsize block_size
)

Description

Allocates block_size bytes of memory, and adds atomic reference counting semantics to it.

The contents of the returned data is set to zero.

The data will be freed when its reference count drops to zero.

The allocated data is guaranteed to be suitably aligned for any built-in type.

Available since:2.58

Parameters

block_size gsize
 

The size of the allocation, must be greater than 0

Return value

Returns: gpointer
 

A pointer to the allocated memory.