From c4a294e498cd456c5421b3ffebdd64b1e15a062d Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 30 Jun 2020 13:52:48 -0400 Subject: add wrapper library to LD_PRELOAD malloc(), calloc(), realloc(), and free() --- src/wrap.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/wrap.c (limited to 'src') 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); +} -- cgit v1.2.1