From c704a8a382c231e066a7fbf0402a33455c40b8f5 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Mon, 21 Apr 2025 21:51:54 -0500 Subject: Rework dlinkedlist functions to use VALLOC macro instead of only xalloc --- src/shared.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/shared.h') diff --git a/src/shared.h b/src/shared.h index 3b0a5f7..7034255 100644 --- a/src/shared.h +++ b/src/shared.h @@ -29,6 +29,11 @@ exit(EXIT_FAILURE); /* Makes gcc happy */\ } while (0) +// Whether to use `XALLOC` or normal `malloc` functions for acquiring new memory via the `VALLOC()` macro. `> 0` +// enables XALLOC functionality +#define ___VXGG___USE_XALLOC_FOR_VALLOC___ 0 +#define VALLOC(nmemb, size) ((___VXGG___USE_XALLOC_FOR_VALLOC___ > 0) ? xmalloc((nmemb) * (size)) : malloc((nmemb) * (size))) + // Error macro that gcc will not complain about #define ERROR(status, errnum, format, ...) do {error((status), (errnum), (format)__VA_ARGS__); exit((status));} while (0) -- cgit v1.2.3