From 7dd566bbaf37221a21b3724e5211a2a03de93c1e Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Fri, 24 Jan 2020 03:39:12 +0000 Subject: Add myalloc.h --- myalloc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 myalloc.h (limited to 'myalloc.h') diff --git a/myalloc.h b/myalloc.h new file mode 100644 index 0000000..42a6259 --- /dev/null +++ b/myalloc.h @@ -0,0 +1,16 @@ +/** + * @brief Allocates memory for the user to use for data storage. + * + * @param size The size of the memory space requested, in bytes. + * @returns A pointer to memory, at least the size of that requested, + * that the user can write to, or `NULL` if such memory cannot be + * allocated. + */ +void* myalloc(int size); + +/** + * @brief Frees a chunk of memory, allowing other processes to use it. + * + * @param ptr A pointer to the start of the memory that should be freed. + */ +void myfree(void* ptr); -- cgit v1.2.1