From 960f79fa50009fd1e95a294547e3e46494d49484 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 17 Sep 2025 09:49:22 +0200 Subject: alloc changes --- common.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 549822a..4587315 100644 --- a/common.h +++ b/common.h @@ -342,12 +342,16 @@ struct arena { uchar mem[]; }; +extern struct arena *globarena; + #define vec_of(T) struct { T *p; int _cap; uint n; } /* libc *alloc wrappers */ +void *xmalloc(size_t n, const char *); void *xcalloc(size_t n, const char *); void *xrealloc(void *, size_t n, const char *); void free(void *); +#define xmalloc(n) xmalloc(n, __func__) #define xcalloc(n) xcalloc(n, __func__) #define xrealloc(p,n) xrealloc(p, n, __func__) -- cgit v1.2.3