From 2b28e8f7d260effdd036bd9e5a3c024070f9882e Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 19 Dec 2023 19:30:13 -0500 Subject: make allocator helpers inlines this gets us better log messages when using -fsanitize=address Signed-off-by: Kent Overstreet --- tools-util.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'tools-util.c') diff --git a/tools-util.c b/tools-util.c index 5b0c1bf5..8e25cac8 100644 --- a/tools-util.c +++ b/tools-util.c @@ -51,36 +51,6 @@ char *mprintf(const char *fmt, ...) return str; } -void *xcalloc(size_t count, size_t size) -{ - void *p = calloc(count, size); - - if (!p) - die("insufficient memory"); - - return p; -} - -void *xmalloc(size_t size) -{ - void *p = malloc(size); - - if (!p) - die("insufficient memory"); - - memset(p, 0, size); - return p; -} - -void *xrealloc(void *p, size_t size) -{ - p = realloc(p, size); - if (!p) - die("insufficient memory"); - - return p; -} - void xpread(int fd, void *buf, size_t count, off_t offset) { while (count) { -- cgit v1.2.3