From e02e1403b432f8cd6d07ebbdd235627f20f01cfb Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sat, 6 Jun 2020 12:30:48 -0700 Subject: small changes to exposure of allocation functions --- include/libn.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'include') 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; -- cgit v1.2.1