Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit ab76231

Browse files
author
Leandro Dorileo
committed
OOM: add file and function name to OOM message
Signed-off-by: Leandro Dorileo <[email protected]>
1 parent e969b25 commit ab76231

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/util.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
#include <string.h>
2222
#include <sys/types.h>
2323

24-
#define DECLARE_OOM() (fputs("Out of memory\n", stderr))
24+
#define DECLARE_OOM() \
25+
{ \
26+
fputs("("__FILE__":", stderr); \
27+
fputs(__func__, stderr); \
28+
fputs("()) Out of memory\n", stderr); \
29+
\
30+
}
2531

2632
#define OOM_CHECK(x) \
2733
{ \

0 commit comments

Comments
 (0)