summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-09-16 13:24:41 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-09-16 13:24:41 -0400
commit4aac7b1a9a3696ee06d193061a893e5290b79124 (patch)
tree2a821d27e94bcb26052c850bff056da02a5ef7a0 /gc.c
parent25711683e86271385e8abe09a9c03782000e48db (diff)
Another try to fix build in emscripten
malloc_trim is defined in emscripten/emmalloc.h on emscripten.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index cc4406c0c9..6535a62851 100644
--- a/gc.c
+++ b/gc.c
@@ -62,6 +62,11 @@
#ifdef HAVE_MALLOC_TRIM
# include <malloc.h>
+
+# ifdef __EMSCRIPTEN__
+/* malloc_trim is defined in emscripten/emmalloc.h on emscripten. */
+# include <emscripten/emmalloc.h>
+# endif
#endif
#if !defined(PAGE_SIZE) && defined(HAVE_SYS_USER_H)