From 49dc19c53b7f444dd4fc17d17e3385fbabaa34a0 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 4 Sep 2011 19:26:19 +0200 Subject: [PATCH] can't trust mmap in OSX: it runs all over allocated memory. --- H/Yap.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/H/Yap.h b/H/Yap.h index 74fa8d810..c13bed032 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -691,7 +691,13 @@ typedef enum if you place things in the lower addresses (power to the libc people). */ -#if (defined(_AIX) || (defined(__APPLE__) && !defined(__LP64__)) || defined(_WIN32) || defined(sparc) || defined(__sparc) || defined(mips) || defined(__FreeBSD__) || defined(_POWER) || defined(__POWERPC__) || defined(__linux__) || defined(IN_SECOND_QUADRANT) || defined(__CYGWIN__)) || defined(__NetBSD__) || defined(__DragonFly__) +#if defined(__APPLE__) +/* mmap on __APPLE__ is not the greatest idea. It overwrites memory allocated by malloc */ +#undef USE_DL_MALLOC +#ifndef USE_SYSTEM_MALLOC +#define USE_SYSTEM_MALLOC 1 +#endif +#elif (defined(_AIX) || (defined(__APPLE__) && !defined(__LP64__)) || defined(_WIN32) || defined(sparc) || defined(__sparc) || defined(mips) || defined(__FreeBSD__) || defined(_POWER) || defined(__POWERPC__) || defined(__linux__) || defined(IN_SECOND_QUADRANT) || defined(__CYGWIN__)) || defined(__NetBSD__) || defined(__DragonFly__) #define USE_LOW32_TAGS 1 #endif