Nyx Node
Loading...
Searching...
No Matches
Memory

Macros

#define buff_t   /*-*/ void *
 Alias for void *.
 
#define BUFF_t   const void *
 Alias for const void *.
 
#define str_t   /*-*/ char *
 Alias for char *.
 
#define STR_t   const char *
 Alias for const char *.
 
#define buffof(p)    ((buff_t *) (p))
 

Functions

void nyx_memory_initialize (void)
 Initialize the memory subsystem.
 
bool nyx_memory_finalize (void)
 Finalize the memory subsystem.
 
__NYX_ZEROABLE__ size_t nyx_memory_free (__NYX_NULLABLE__ buff_t buff)
 Similar to libc free except that it returns the amount of memory freed.
 
__NYX_NULLABLE__ buff_t nyx_memory_alloc (__NYX_ZEROABLE__ size_t size)
 Similar to libc malloc except that a memory overflow causes the node to stop.
 
__NYX_NULLABLE__ buff_t nyx_memory_realloc (__NYX_NULLABLE__ buff_t buff, __NYX_ZEROABLE__ size_t size)
 Similar to libc realloc except that a memory overflow causes the node to stop.
 
__NYX_NULLABLE__ str_t nyx_string_dup (__NYX_NULLABLE__ STR_t s)
 Similar to libc strdup.
 
__NYX_NULLABLE__ str_t nyx_string_ndup (__NYX_NULLABLE__ STR_t s, __NYX_ZEROABLE__ size_t n)
 Similar to libc strndup.
 

Detailed Description

Memory primitives with leak detection.

Macro Definition Documentation

◆ buff_t

#define buff_t   /*-*/ void *

Alias for void *.

Definition at line 67 of file nyx_node.h.

◆ BUFF_t

#define BUFF_t   const void *

Alias for const void *.

Definition at line 68 of file nyx_node.h.

◆ str_t

#define str_t   /*-*/ char *

Alias for char *.

Definition at line 70 of file nyx_node.h.

◆ STR_t

#define STR_t   const char *

Alias for const char *.

Definition at line 71 of file nyx_node.h.

◆ buffof

#define buffof (   p)     ((buff_t *) (p))

Definition at line 75 of file nyx_node.h.

Function Documentation

◆ nyx_memory_initialize()

void nyx_memory_initialize ( void  )

Initialize the memory subsystem.

Definition at line 37 of file object.c.

◆ nyx_memory_finalize()

bool nyx_memory_finalize ( void  )

Finalize the memory subsystem.

Definition at line 50 of file object.c.