picofuse

Data Structures | Typedefs
arena.h File Reference

Defines arena allocator types and operations. More...

#include <stddef.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  sys_mem_stats_t
 Snapshot of arena usage statistics. More...
 

Typedefs

typedef struct sys_mem_arena_t sys_mem_arena_t
 Arena allocator handle.
 
typedef struct sys_mem_stats_t sys_mem_stats_t
 Snapshot of arena usage statistics.
 

Functions

Arena Lifecycle
sys_mem_arena_tsys_mem_arena_init (size_t size, sys_mem_arena_t *prev, void *(*malloc_fn)(size_t size), void(*free_fn)(void *ptr))
 Initialize a new arena. More...
 
void sys_mem_arena_delete (sys_mem_arena_t *arena)
 Delete the tail arena of a chain. More...
 
sys_mem_arena_tsys_mem_arena_next (sys_mem_arena_t *arena, sys_mem_stats_t *stats)
 Return the next arena in a chain. More...
 
Arena Allocation
void * sys_mem_arena_alloc (sys_mem_arena_t *arena, size_t size)
 Allocate memory from a single arena. More...
 
void * sys_mem_arena_realloc (sys_mem_arena_t *arena, void *ptr, size_t size)
 Resize an allocation within a single arena. More...
 
void sys_mem_arena_free (sys_mem_arena_t *arena, void *ptr)
 Release an allocation owned by a single arena. More...
 

Detailed Description

Defines arena allocator types and operations.

Definition in file arena.h.