This commit is contained in:
Nils O. Selåsdal
2026-06-09 11:36:27 +02:00
parent a092599a1a
commit b06b78aeef
6 changed files with 40 additions and 29 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
#include "base_core.h"
typedef U32 ArenaFlags; // no flags defined yets
typedef U32 ArenaFlags; // no flags defined yet
typedef struct ArenaParams ArenaParams;
struct ArenaParams {
@@ -31,8 +31,8 @@ struct Arena {
S32 checkpoint_level;
};
typedef struct ArenaCheckPoint ArenaCheckPoint;
struct ArenaCheckPoint {
typedef struct ArenaCheckpoint ArenaCheckpoint;
struct ArenaCheckpoint {
Arena *arena;
U32 absolute_pos;
};
@@ -47,11 +47,11 @@ void *arena_push(Arena *arena, U32 size, U32 align);
#define arena_push_type(arena, type) arena_push(arena, (U32)sizeof(type), alignof(type))
#define arena_push_array_of(arena, type, len) arena_push(arena, (U32) (sizeof(type) * (len)), alignof(type))
ArenaCheckPoint arena_temp_begin(Arena *arena);
void arena_temp_end(ArenaCheckPoint *checkpoint);
ArenaCheckpoint arena_temp_begin(Arena *arena);
void arena_temp_end(ArenaCheckpoint *checkpoint);
void arena_pop_to(Arena *arena, U32 abs_pos);
void arena_reset(Arena *arena);
MemoryBlock *memoryblock_allocate(size_t size, size_t commit_size);
MemoryBlock *memoryblock_allocate(U32 size, U32 commit_size);
static INLINE U32 memoryblock_available(const MemoryBlock *block)