summaryrefslogtreecommitdiff
path: root/system/lib/dlmalloc.c
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-15 16:51:29 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-15 16:51:29 -0700
commit41e7af7eeb7f0d0a3991abd7ff87177308570c54 (patch)
tree3c0684b6549c0e186032ca38252bc40fc4657273 /system/lib/dlmalloc.c
parentb1eaf55eefb815e8f3556b59ce64e6d1e0f55d55 (diff)
parent2e229a560955c07d1b66db27913af3284baa64fb (diff)
Merge branch 'incoming'
Diffstat (limited to 'system/lib/dlmalloc.c')
-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..ce2c25f1 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 grow 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