Function

GLibmalloc

Declaration

gpointer
g_malloc (
  gsize n_bytes
)

Description

Allocates n_bytes bytes of memory. If n_bytes is 0 it returns NULL.

If the allocation fails (because the system is out of memory), the program is terminated.

Parameters

n_bytes

Type: gsize

The number of bytes to allocate.

Return value

Type: gpointer

A pointer to the allocated memory.

The data is owned by the called function.
The return value can be NULL.