diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-07-30 14:44:00 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-07-30 14:44:00 -0700 |
| commit | 3445982b16a3f8bf910d5ab679d840bb8d9ec20e (patch) | |
| tree | 52df7e3b15d06dcb1289011c1ee9fb7aed1d3893 /utils.h | |
| parent | ad640caac60bcb000ea0647b77f809a714aaaad2 (diff) | |
Ergonomic improvement: xcalloc -> new(), xrealloc -> grow()
Diffstat (limited to 'utils.h')
| -rw-r--r-- | utils.h | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |
