From c65669a785fba9b1f0f7539f47a677035ea06229 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 2 Dec 2017 01:07:20 +0100 Subject: Add some common utility functions Signed-off-by: pacien --- include/common/mem.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/common/mem.h (limited to 'include/common/mem.h') diff --git a/include/common/mem.h b/include/common/mem.h new file mode 100644 index 0000000..1c46778 --- /dev/null +++ b/include/common/mem.h @@ -0,0 +1,23 @@ +#ifndef UPEM_MORPHING_MEM +#define UPEM_MORPHING_MEM + +/** + * File: mem.h + */ + +#include + +/** + * Function: malloc_or_die + * Allocates a memory chunk of the requested size. + * Interrupts the execution of the program in case of an error. + * + * Parameters: + * size - size of the chunk to allocate + * + * Returns: + * A non-NULL pointer to the allocated chunk + */ +void *malloc_or_die(size_t size); + +#endif -- cgit v1.2.3