Subastra
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
arena.h File Reference
#include <string.h>
#include "defs.h"
#include "memory.h"
Include dependency graph for arena.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  arena_t
 The Arena allocator is a single continous block of memory. More...
 

Macros

#define ARENA_DEFAULT_SIZE   0x10000
 

Functions

static void arena_init_default (arena_t *arena)
 Initializes the memory arena using malloc with ARENA_DEFAULT_SIZE bytes of memory.
 
static void * arena_alloc (arena_t *arena, sz size)
 Allocate size bytes data inside the arena. O(1)
 

Variables

static arena_t ARENA_GLOBAL
 The single global arena. Declared here instead of specific files to prevent aliasing issues.
 

Macro Definition Documentation

◆ ARENA_DEFAULT_SIZE

#define ARENA_DEFAULT_SIZE   0x10000

Function Documentation

◆ arena_alloc()

static void * arena_alloc ( arena_t arena,
sz  size 
)
static

Allocate size bytes data inside the arena. O(1)

◆ arena_init_default()

static void arena_init_default ( arena_t arena)
static

Initializes the memory arena using malloc with ARENA_DEFAULT_SIZE bytes of memory.

Variable Documentation

◆ ARENA_GLOBAL

arena_t ARENA_GLOBAL
static

The single global arena. Declared here instead of specific files to prevent aliasing issues.