robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #29241 from bfredl/shadapackba70404c55

master
289 B17 linesraw
1#pragma once
2
3#include <stddef.h>
4
5typedef struct consumed_blk {
6  struct consumed_blk *prev;
7} *ArenaMem;
8
9typedef struct {
10  char *cur_blk;
11  size_t pos, size;
12} Arena;
13
14#define ARENA_BLOCK_SIZE 4096
15
16// inits an empty arena.
17#define ARENA_EMPTY { .cur_blk = NULL, .pos = 0, .size = 0 }