summaryrefslogtreecommitdiff
path: root/rts/xxhash.c
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-08-21 15:09:18 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-05 14:50:52 -0400
commit7980ae23696f2406c65ee498155b26c09d3d4394 (patch)
treeea87c834bafc8167e6c82b3ae11169e92bcd8c09 /rts/xxhash.c
parent4813486f8756fde7889b214e6e41ae63465f7ad7 (diff)
downloadhaskell-7980ae23696f2406c65ee498155b26c09d3d4394.tar.gz
rts: Consistently use stgMallocBytes instead of malloc
This can help in debugging RTS memory leaks since all allocations go through the same interface.
Diffstat (limited to 'rts/xxhash.c')
-rw-r--r--rts/xxhash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/rts/xxhash.c b/rts/xxhash.c
index fd63ba89dd..c72b4c2dad 100644
--- a/rts/xxhash.c
+++ b/rts/xxhash.c
@@ -98,9 +98,11 @@
***************************************/
/*! Modify the local functions below should you wish to use some other memory routines
* for malloc(), free() */
-#include <stdlib.h>
-static void* XXH_malloc(size_t s) { return malloc(s); }
-static void XXH_free (void* p) { free(p); }
+#include "Rts.h"
+#include "RtsUtils.h"
+
+static void* XXH_malloc(size_t s) { return stgMallocBytes(s, "XXH_malloc"); }
+static void XXH_free (void* p) { stgFree(p); }
/*! and for memcpy() */
#include <string.h>
static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }