summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-06-30 13:52:48 -0400
committerJakob Kaivo <jkk@ung.org>2020-06-30 13:52:48 -0400
commitc4a294e498cd456c5421b3ffebdd64b1e15a062d (patch)
tree913ba7732e0b5da439f9d88bd8094e5c20890df4 /src
parentbbac7666e763af9b65ef919b451f5930608a516a (diff)
add wrapper library to LD_PRELOAD malloc(), calloc(), realloc(), and free()
Diffstat (limited to 'src')
-rw-r--r--src/wrap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
new file mode 100644
index 0000000..524d6d2
--- /dev/null
+++ b/src/wrap.c
@@ -0,0 +1,21 @@
+#include "mapalloc.h"
+
+void *malloc(size_t n)
+{
+ return map_malloc(n);
+}
+
+void *calloc(size_t n, size_t e)
+{
+ return map_calloc(n, e);
+}
+
+void *realloc(void *p, size_t n)
+{
+ return map_realloc(p, n);
+}
+
+void free(void *p)
+{
+ map_free(p);
+}