Base/platform/exports/librr/alloc/arena.h

23 lines
445 B
C

#ifndef RR_ARENA_ALLOCATOR_H
#define RR_ARENA_ALLOCATOR_H
#include <librr/types.h>
typedef struct rr_arena rr_arena_s;
struct rr_arena
{
usz_t capacity;
usz_t offset;
char *allocation;
};
rr_arena_s rr_new_arena(usz_t capacity);
void rr_delete_arena(rr_arena_s *arena);
void * rr_arena_alloc(rr_arena_s *arena, usz_t length);
char * rr_arena_clone_string(rr_arena_s *arena, const char *string);
#endif // RR_ARENA_ALLOCATOR_H