diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libn.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/libn.h b/include/libn.h index 38f0a3a..d47e7c5 100644 --- a/include/libn.h +++ b/include/libn.h @@ -59,6 +59,7 @@ typedef struct Iface { // ----------------------------------------------------------------------------- // memory allocation +// TODO(nnoll): Allow for nil iterfaces? /* allocator interface */ typedef struct mem·Allocator { void *(*alloc)(void *iface, uint n, ulong size); @@ -72,17 +73,8 @@ typedef struct mem·Reallocator { } mem·Reallocator; /* system implementation */ -extern void ·free(void* _, void *ptr); -extern void *·alloc(void* _, uint n, ulong size); -extern void *·calloc(void* _, uint n, ulong size); -extern void *·realloc(void* _, void *ptr, uint n, ulong size); - -// TODO(nnoll): Allow for nil iterfaces? -static -mem·Allocator mem·sys = { - .alloc = ·alloc, - .free = ·free -}; +extern mem·Allocator mem·sys; +extern mem·Reallocator mem·rsys; /* simple memory arena */ typedef struct mem·Arena mem·Arena; |