GLib.malloc0
Description: Reference for GLib.malloc0

### Function

# GLibmalloc0

since: 2.0

#### Declaration

    gpointer
    g_malloc0 (
      gsize n_bytes
    )

#### Description

Allocates `n_bytes` bytes of memory, initialized to 0’s. If `n_bytes` is 0 it returns `NULL`.

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

Available since: 2.0

#### 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`.