aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-17 09:49:22 +0200
committerlemon <lsof@mailbox.org>2025-09-17 09:49:22 +0200
commit960f79fa50009fd1e95a294547e3e46494d49484 (patch)
tree93fbb3bb326f7efb8cfdfb249f0d1b76ef25d3bc /common.h
parent3d0c49f4eb9e13e00bf12940b53da0f018c0a58c (diff)
alloc changes
Diffstat (limited to 'common.h')
-rw-r--r--common.h4
1 files changed, 4 insertions, 0 deletions
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__)