---
name: "rmem"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rmem"
---

# rmem(3)

memory allocation functions

## NAME

rmem - memory allocation functions

## SYNOPSIS

\#include \<roy.h\>

void \* rmem\_alloc (size\_t *size*);

void \* rmem\_alloc0 (size\_t *size*);

void rmem\_free (void \**ptr*);

void \* rmem\_realloc (void \**ptr*, size\_t *size*);

void \* rmem\_new (*type*, int *num*);

void \* rmem\_new0 (*type*, int *num*);

## DESCRIPTION

The rmem functions are basically just wrappers around [*malloc*(3)](/malloc/3.md), [*free*(3)](/free/3.md), and [*realloc*(3)](/realloc/3.md).  However, we have implemented a backend which allows you to detect various memory related problems.  See [*rmdbg*(3)](/rmdbg/3.md) for more details.

rmem\_alloc allocates memory just like [*malloc*(3)](/malloc/3.md).

rmem\_alloc0 allocates memory, and returns it zero'd.

rmem\_free frees allocated memory, allocated via any of these functions/macros.

rmem\_realloc reallocates memory just like [*realloc*(3)](/realloc/3.md).

rmem\_new is a macro that allocates *num* number of types *type*.

rmem\_new0 is a macro that allocates *num* number of types *type*, and zeros this memory before returning it.

## SEE ALSO

[*rmem\_alloc*(3)](/rmem_alloc/3.md), [*rmem\_alloc0*(3)](/rmem_alloc0/3.md),  [*rmem\_free*(3)](/rmem_free/3.md), [*rmem\_new*(3)](/rmem_new/3.md),  [*rmem\_new0*(3)](/rmem_new0/3.md), [*rmem\_realloc*(3)](/rmem_realloc/3.md),  [*roy*(3)](/roy/3.md), [*malloc*(3)](/malloc/3.md),  [*free*(3)](/free/3.md), [*realloc*(3)](/realloc/3.md),  [*calloc*(3)](/calloc/3.md), [*rmdbg*(3)](/rmdbg/3.md)
