summaryrefslogtreecommitdiff
path: root/system/lib/dlmalloc.c
diff options
context:
space:
mode:
authorJames Gregory <james@james.id.au>2013-08-19 14:01:32 -0700
committerJames Gregory <james@james.id.au>2013-08-19 14:01:32 -0700
commitafcdfff09f8557ce6810546628733f48d6c45408 (patch)
tree9c556c29a0556429dc1b421b2d5abade1915a034 /system/lib/dlmalloc.c
parent46c82708d50e839945fa24094fe352241be6a22e (diff)
parentcd38275faf739ba151c0aa7abe13703c9b8d8235 (diff)
Merge remote-tracking branch 'origin/incoming' into touch_handling
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