summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/quickjs.c b/quickjs.c
index 3cb2643..642ae34 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -34,7 +34,7 @@
#include <math.h>
#if defined(__APPLE__)
#include <malloc/malloc.h>
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__GLIBC__)
#include <malloc.h>
#elif defined(__FreeBSD__)
#include <malloc_np.h>
@@ -1708,7 +1708,7 @@ static size_t js_def_malloc_usable_size(const void *ptr)
return _msize((void *)ptr);
#elif defined(EMSCRIPTEN)
return 0;
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__GLIBC__)
return malloc_usable_size((void *)ptr);
#else
/* change this to `return 0;` if compilation fails */