Files
mop3/libarena/arena.h
kamkow1 961bf54ec1
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m10s
CE allocate tokens with arena
2026-02-25 18:27:51 +01:00

27 lines
466 B
C

#ifndef _LIBARENA_ARENA_H
#define _LIBARENA_ARENA_H
#include <stddef.h>
#include <stdint.h>
#define ARENA_CHUNK_CAPACITY (8 * 1024)
struct arena_chunk {
struct arena_chunk* next;
size_t capacity;
size_t size;
uintptr_t memory[];
};
struct arena {
struct arena_chunk *begin, *end;
};
void arena_reset (struct arena* arena);
void arena_destroy (struct arena* arena);
void* arena_malloc (struct arena* arena, size_t size);
#endif // _LIBARENA_ARENA_H