## gegl-memory

gegl-memory

## Functions

gpointer | gegl_malloc ()
gpointer | gegl_try_malloc ()
void | gegl_free ()
gpointer | gegl_calloc ()
gboolean | gegl_memeq_zero ()
void | gegl_memset_pattern ()

## Description

## Functions

### gegl_malloc ()

    gpointer
    gegl_malloc (gsize n_bytes);

Allocates `n_bytes` of memory. If `n_bytes` is 0, returns NULL.

Returns a pointer to the allocated memory.

[skip]

#### Parameters

n_bytes | the number of bytes to allocte. |

### gegl_try_malloc ()

    gpointer
    gegl_try_malloc (gsize n_bytes);

Allocates `n_bytes` of memory. If allocation fails, or if `n_bytes` is 0, returns `NULL`.

Returns a pointer to the allocated memory, or NULL.

[skip]

#### Parameters

n_bytes | the number of bytes to allocte. |

### gegl_free ()

    void
    gegl_free (gpointer mem);

Frees the memory pointed to by `mem` . If `mem` is NULL, does nothing.

[skip]

#### Parameters

mem | the memory to free. |

### gegl_calloc ()

    gpointer
    gegl_calloc (gsize size,
                 gint n_memb);

allocated 0'd memory.

[skip]

#### Parameters

size | size of items to allocate |
n_memb | number of members |

### gegl_memeq_zero ()

    gboolean
    gegl_memeq_zero (gconstpointer ptr,
                     gsize size);

Checks if all the bytes of the memory block `ptr` , of size `size` , are equal to zero.

[skip]

#### Parameters

ptr | pointer to the memory block |
size | block size |

#### Returns

TRUE if all the bytes are equal to zero.

### gegl_memset_pattern ()

    void
    gegl_memset_pattern (gpointer dst_ptr,
                         gconstpointer src_ptr,
                         gint pattern_size,
                         gint count);

Fill `dst_ptr` with `count` copies of the bytes in `src_ptr` .

[skip]

#### Parameters

dst_ptr | pointer to copy to |
src_ptr | pointer to copy from |
pattern_size | the length of `src_ptr` |
count | number of copies |