diff options
| author | 2022-08-15 12:22:47 +0200 | |
|---|---|---|
| committer | 2022-08-15 12:22:47 +0200 | |
| commit | f906d0b350b0b4ceb747669c9a9845d11bd0e486 (patch) | |
| tree | 5f09a7b714e6ce93f6094a06e5f736513110fb8d /src/mem.hff | |
| parent | f802bb99263aaa5be492999babd44cd2fdb1c65f (diff) | |
self hosted progress
Diffstat (limited to 'src/mem.hff')
| -rw-r--r-- | src/mem.hff | 4 |
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)) ] |