aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-08 18:12:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-08 18:13:50 -0700
commit470c1319917c6f30dd786a52ed126012d65a6457 (patch)
tree4275893aee450ef9e98b5b925f20dcb978eb2d24
parentbd1d02e02cf0f39c8d7f672520910714d1c2d4e5 (diff)
collect malloc defaults for emscripten, and do not try to trim
-rw-r--r--system/lib/dlmalloc.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/system/lib/dlmalloc.c b/system/lib/dlmalloc.c
index e833ae42..a04ecbf6 100644
--- a/system/lib/dlmalloc.c
+++ b/system/lib/dlmalloc.c
@@ -1,4 +1,14 @@
+/* XXX Emscripten XXX */
+#if EMSCRIPTEN
+#define DLMALLOC_EXPORT __attribute__((__weak__, __visibility__("default")))
+/* mmap uses malloc, so malloc can't use mmap */
+#define HAVE_MMAP 0
+/* we can only glow the heap up anyhow, so don't try to trim */
+#define MORECORE_CANNOT_TRIM 1
+#endif
+
+
#define __THROW
#define __attribute_malloc__
#define __wur
@@ -532,10 +542,6 @@
#define DLMALLOC_VERSION 20806
#endif /* DLMALLOC_VERSION */
-#if EMSCRIPTEN
-#define DLMALLOC_EXPORT __attribute__((__weak__, __visibility__("default")))
-#endif
-
#ifndef DLMALLOC_EXPORT
#define DLMALLOC_EXPORT extern
#endif
@@ -647,15 +653,7 @@ defined(__i386__) || defined(__x86_64__))) || \
#define MALLOC_INSPECT_ALL 0
#endif /* MALLOC_INSPECT_ALL */
#ifndef HAVE_MMAP
-/* XXX Emscripten
- * mmap uses malloc, so malloc can't use mmap
- */
-#ifdef EMSCRIPTEN
-#define HAVE_MMAP 0
-#else
#define HAVE_MMAP 1
-#endif
-
#endif /* HAVE_MMAP */
#ifndef MMAP_CLEARS
#define MMAP_CLEARS 1