aboutsummaryrefslogtreecommitdiff
path: root/src/mem.hff
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem.hff')
-rw-r--r--src/mem.hff4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem.hff b/src/mem.hff
index 805c3ce..7858f4d 100644
--- a/src/mem.hff
+++ b/src/mem.hff
@@ -1,7 +1,7 @@
import "libc.hff";
defmacro ALIGNUP(x,a) [ (((x) + ((a) - 1)) & -(a)) ]
-def ARENA_SIZE = 16 * 1024;
+def ARENA_SIZE = 4 * 1024;
extern fn xmalloc(n usize) *void;
extern fn xcalloc(n usize, m usize) *void;
extern fn xrealloc(p *void, n usize) *void;
@@ -68,3 +68,5 @@ struct Allocator {
}
}
}
+
+defmacro anew(a, T) [ ((a)->alloc(sizeof T)) ]