diff options
| author | @syxhe <https://t.me/syxhe> | 2025-04-21 21:51:54 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-04-21 21:51:54 -0500 |
| commit | c704a8a382c231e066a7fbf0402a33455c40b8f5 (patch) | |
| tree | 0c4000906060013de91ea7fc1888cedcbc34159e /src/shared.h | |
| parent | 521e9a2fc8e0ef1dffe4e590d0d4f65292f0d1df (diff) | |
Rework dlinkedlist functions to use VALLOC macro instead of only xalloc
Diffstat (limited to 'src/shared.h')
| -rw-r--r-- | src/shared.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ | |||
| 29 | exit(EXIT_FAILURE); /* Makes gcc happy */\ | 29 | exit(EXIT_FAILURE); /* Makes gcc happy */\ |
| 30 | } while (0) | 30 | } while (0) |
| 31 | 31 | ||
| 32 | // Whether to use `XALLOC` or normal `malloc` functions for acquiring new memory via the `VALLOC()` macro. `> 0` | ||
| 33 | // enables XALLOC functionality | ||
| 34 | #define ___VXGG___USE_XALLOC_FOR_VALLOC___ 0 | ||
| 35 | #define VALLOC(nmemb, size) ((___VXGG___USE_XALLOC_FOR_VALLOC___ > 0) ? xmalloc((nmemb) * (size)) : malloc((nmemb) * (size))) | ||
| 36 | |||
| 32 | // Error macro that gcc will not complain about | 37 | // Error macro that gcc will not complain about |
| 33 | #define ERROR(status, errnum, format, ...) do {error((status), (errnum), (format)__VA_ARGS__); exit((status));} while (0) | 38 | #define ERROR(status, errnum, format, ...) do {error((status), (errnum), (format)__VA_ARGS__); exit((status));} while (0) |
| 34 | 39 | ||
