Skip to content

Commit

Permalink
OOM: add file and function name to OOM message
Browse files Browse the repository at this point in the history
Signed-off-by: Leandro Dorileo <[email protected]>
  • Loading branch information
Leandro Dorileo committed May 14, 2020
1 parent e969b25 commit ab76231
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
#include <string.h>
#include <sys/types.h>

#define DECLARE_OOM() (fputs("Out of memory\n", stderr))
#define DECLARE_OOM() \
{ \
fputs("("__FILE__":", stderr); \
fputs(__func__, stderr); \
fputs("()) Out of memory\n", stderr); \
\
}

#define OOM_CHECK(x) \
{ \
Expand Down

0 comments on commit ab76231

Please sign in to comment.