From 85ba301f52b1c7e1ad928803b14b6c70776f2235 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 16 Dec 2023 11:47:59 -0500 Subject: use hashmap for compound tag --- src/lib.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lib.c') diff --git a/src/lib.c b/src/lib.c index 7f077ba..e6e691a 100644 --- a/src/lib.c +++ b/src/lib.c @@ -3,6 +3,7 @@ #include #include #include +#include __attribute__((__noreturn__)) static void die() { @@ -36,6 +37,12 @@ void *xalloc(size_t amount) { return res; } +void *xzalloc(size_t amount) { + void *res = xalloc(amount); + memset(res, 0, sizeof(amount)); + return res; +} + void *xrealloc(void *ptr, size_t amount) { void *res = realloc(ptr, amount); if (res == NULL) -- cgit v1.2.3-freya