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
|
#ifndef MEMORY_H
|
||||||
#define MEMORY_H
|
#define MEMORY_H
|
||||||
|
|
||||||
|
|
||||||
#ifndef MEM_ARENA_MAX_CAP
|
#ifndef MEM_ARENA_MAX_CAP
|
||||||
#define MEM_ARENA_MAX_CAP 1024 * 1024
|
#define MEM_ARENA_MAX_CAP 1024 * 1024
|
||||||
#endif
|
#endif
|
||||||
@@ -20,16 +19,20 @@ struct Backend
|
|||||||
size_t cap;
|
size_t cap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define BACKEND_CONST {NULL, NULL, 0, 0}
|
||||||
|
|
||||||
struct Arena
|
struct Arena
|
||||||
{
|
{
|
||||||
void* mem;
|
void* mem;
|
||||||
void* last;
|
void* last;
|
||||||
size_t len;
|
size_t len;
|
||||||
size_t cap;
|
size_t cap;
|
||||||
void* next;
|
void* next; //TODO
|
||||||
struct Backend* b;
|
struct Backend* b;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define ARENA_CONST {NULL, NULL, 0, 0, NULL}
|
||||||
|
|
||||||
typedef struct Backend Backend;
|
typedef struct Backend Backend;
|
||||||
typedef struct Arena Arena;
|
typedef struct Arena Arena;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user