summaryrefslogtreecommitdiff
path: root/memory.h
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-21 22:27:59 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-21 22:27:59 +0100
commit9c2bef9f407ab1e9fcd4afff430fee5d565b7e87 (patch)
treeddaf6e4f6f1efc97ff4d242ddf690afe4e712316 /memory.h
parented1f63961c96db6491b607ce41ec01d53b4e64a0 (diff)
Level generation! Also push support in tcpHEADmaster
Diffstat (limited to 'memory.h')
-rw-r--r--memory.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/memory.h b/memory.h
index 6fcb7e1..e07bfe8 100644
--- a/memory.h
+++ b/memory.h
@@ -3,6 +3,10 @@
#include <stdlib.h>
#include <string.h>
+void* memdup(void *buf, size_t num);
+
+void* check_after_allocation(const char *funcname, void *ptr);
+
#define malloc(num, type) \
((type*)check_after_allocation("malloc", malloc((num)*sizeof(type))))
@@ -11,6 +15,6 @@
#define realloc(ptr, num, type) \
((type*)check_after_allocation("realloc", realloc(ptr, (num)*sizeof(type))))
#define strdup(str) \
- ((char*)check_after_allocation("strdup", strdup(str)))
-
-void* check_after_allocation(const char *funcname, void *ptr);
+ ((char*)check_after_allocation("strdup", strdup((str))))
+#define memdup(buf, num) \
+ ((char*)check_after_allocation("memdup", memdup((void*)(buf), (num))))