libcute 0.1
Loading...
Searching...
No Matches
Classes | Macros | Functions
arenaallocator.h File Reference
#include "memory/allocator.h"
#include <stddef.h>
Include dependency graph for arenaallocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cu_ArenaAllocator
 
struct  cu_ArenaAllocator_Config
 

Macros

#define CU_ARENA_CHUNK_SIZE   4096
 

Functions

cu_Allocator cu_Allocator_ArenaAllocator (cu_ArenaAllocator *arena, cu_ArenaAllocator_Config config)
 Create an arena allocator using the given configuration.
 
void cu_ArenaAllocator_destroy (cu_ArenaAllocator *arena)
 Destroy an arena allocator and free all chunks.
 

Detailed Description

Arena allocator.

Macro Definition Documentation

◆ CU_ARENA_CHUNK_SIZE

#define CU_ARENA_CHUNK_SIZE   4096

default size for new chunks

Function Documentation

◆ cu_Allocator_ArenaAllocator()

cu_Allocator cu_Allocator_ArenaAllocator ( cu_ArenaAllocator arena,
cu_ArenaAllocator_Config  config 
)

Create an arena allocator using the given configuration.

Parameters
arenaTarget arena allocator instance.
configInitialization settings.
Returns
A cu_Allocator value using the arena.
Here is the call graph for this function:

◆ cu_ArenaAllocator_destroy()

void cu_ArenaAllocator_destroy ( cu_ArenaAllocator arena)

Destroy an arena allocator and free all chunks.

Parameters
arenaPointer to the arena to destroy.