Sturk 1.0.2
Publish-subscribe C implementation.
Loading...
Searching...
No Matches
mem.h File Reference

System memory allocator. More...

#include <stddef.h>
Include dependency graph for mem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ST_NEW(...)   ST__NEW(__VA_ARGS__, 1, )
 Allocate memory for a data type.
 

Functions

void * st_malloc (size_t size)
 
void st_free (void *ptr)
 

Detailed Description

System memory allocator.

Macro Definition Documentation

◆ ST_NEW

#define ST_NEW (   ...)    ST__NEW(__VA_ARGS__, 1, )

Allocate memory for a data type.

A call ST_NEW(type, n) will alocate contiguous memory region of the length that is equal to the multiple of n and the size of type. The n argument is optional and by default it equals 1.

Function Documentation

◆ st_free()

void st_free ( void *  ptr)
See also
free()

◆ st_malloc()

void * st_malloc ( size_t  size)
See also
malloc()