From 964d816726b8c765277b043894d534e9b1e0d60c Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Wed, 11 Jan 2023 23:44:04 +0100 Subject: Check aprintf allocation internally and add astrdup for less OOM_CHECK --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 1d220dc..5ae8b74 100644 --- a/src/util.h +++ b/src/util.h @@ -8,7 +8,6 @@ #define PANIC(...) panic(__FILE__, __LINE__, "" __VA_ARGS__) #define ASSERT(x) assert((x), __FILE__, __LINE__, #x) -#define OOM_CHECK(x) assert((x) != NULL, __FILE__, __LINE__, "Out of Memory!") #define ERROR(...) error("" __VA_ARGS__) #define UPCAST(iter, type, link) LINK_UPCAST(iter, type, link) @@ -17,6 +16,7 @@ void panic(const char *file, int line, const char *msg, ...); void assert(int cond, const char *file, int line, const char *condstr); void error(const char *fmtstr, ...); +char *astrdup(const char *str); char *aprintf(const char *fmtstr, ...); char *appendstrf(char *alloc, const char *fmtstr, ...); -- cgit v1.2.3-71-gd317