From f03688fa74b9bb3f13a106e61a3d7f2e9e85c8f8 Mon Sep 17 00:00:00 2001 From: Himbeer Date: Tue, 17 Sep 2024 10:17:16 +0200 Subject: Add must_malloc helper function malloc(3) can fail, most likely in out-of-memory situations. This helper terminates the program in such cases instead of permitting assignments of null pointers. --- include/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/util.h') diff --git a/include/util.h b/include/util.h index 2a1e72a..12829ef 100644 --- a/include/util.h +++ b/include/util.h @@ -6,4 +6,6 @@ enum exit_status { EXIT_ABNORMAL = 255, }; +void *must_malloc(size_t size); + #endif -- cgit v1.2.3