mirror of
https://github.com/0x221E/ibuild.git
synced 2026-01-18 02:42:20 +00:00
Patch: Add arena constructor to memory.h
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef MEMORY_H
|
||||
#define MEMORY_H
|
||||
|
||||
|
||||
#ifndef MEM_ARENA_MAX_CAP
|
||||
#define MEM_ARENA_MAX_CAP 1024 * 1024
|
||||
#endif
|
||||
@@ -20,16 +19,20 @@ struct Backend
|
||||
size_t cap;
|
||||
};
|
||||
|
||||
#define BACKEND_CONST {NULL, NULL, 0, 0}
|
||||
|
||||
struct Arena
|
||||
{
|
||||
void* mem;
|
||||
void* last;
|
||||
size_t len;
|
||||
size_t cap;
|
||||
void* next;
|
||||
void* next; //TODO
|
||||
struct Backend* b;
|
||||
};
|
||||
|
||||
#define ARENA_CONST {NULL, NULL, 0, 0, NULL}
|
||||
|
||||
typedef struct Backend Backend;
|
||||
typedef struct Arena Arena;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user