aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-07-30 14:44:00 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-07-30 14:44:00 -0700
commit3445982b16a3f8bf910d5ab679d840bb8d9ec20e (patch)
tree52df7e3b15d06dcb1289011c1ee9fb7aed1d3893 /utils.h
parentad640caac60bcb000ea0647b77f809a714aaaad2 (diff)
Ergonomic improvement: xcalloc -> new(), xrealloc -> grow()
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/utils.h b/utils.h
index 96b1aeb..08830be 100644
--- a/utils.h
+++ b/utils.h
@@ -14,8 +14,7 @@
#define streq(a, b) (strcmp(a, b) == 0)
#define new(t) memcheck(calloc(1, sizeof(t)))
-#define xcalloc(a,b) memcheck(calloc(a,b))
-#define xrealloc(a,b) memcheck(realloc(a,b))
+#define grow(arr,n) memcheck(realloc(arr,sizeof(arr[0])*(n)))
__attribute__((nonnull(1)))
char unescapechar(const char *escaped, const char **end);