aboutsummaryrefslogtreecommitdiff
path: root/include/libn.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libn.h')
-rw-r--r--include/libn.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/include/libn.h b/include/libn.h
index 30b4c87..2b8dc4c 100644
--- a/include/libn.h
+++ b/include/libn.h
@@ -52,31 +52,22 @@ void* bufgrow(void*, vlong, vlong);
void _bufpop(void*, int, vlong);
// -----------------------------------------------------------------------------
-// interfaces
-// TODO(nnoll): Think about this idea
-/*
-typedef struct Iface {
- void* impl;
- byte fcn[];
-} Iface;
-*/
-// -----------------------------------------------------------------------------
// memory allocation
// TODO(nnoll): Allow for nil iterfaces?
/* allocator interface */
typedef struct mem·Allocator {
- void *(*alloc)(void *iface, uint n, ulong size);
- void (*free)(void *iface, void *ptr);
+ void *(*alloc)(void *heap, uint n, ulong size);
+ void (*free)(void *heap, void *ptr);
} mem·Allocator;
-extern mem·Allocator mem·System;
+extern mem·Allocator sys·Memory;
typedef struct mem·Reallocator {
void *(*alloc)(void *iface, uint n, ulong size);
void *(*realloc)(void *iface, void *ptr, uint n, ulong size);
void (*free)(void *iface, void *ptr);
} mem·Reallocator;
-extern mem·Reallocator mem·FullSystem;
+extern mem·Reallocator sys·Relocator;
/* simple memory arena */
typedef struct mem·Arena mem·Arena;