kripken/emscripten — pull request #846 by juj (2013-02-12 00:22:47+00:00)
Title: Dlmalloc 286

The first commit updates dlmalloc.c to version 2.8.6 from ftp://gee.cs.oswego.edu/pub/misc/malloc.c . This fixes a memory allocation failure issue when building test_dlmalloc.c natively to OSX.

The following modifications are present in he dlmalloc.c file:

1. Added
#define __THROW
#define __attribute_malloc__
#define __wur

to the beginning of the file, like was in the previous version.

2. When configuring mmap use, use a section

/* XXX Emscripten
* mmap uses malloc, so malloc can't use mmap
*/
#ifdef EMSCRIPTEN
#define HAVE_MMAP 0
#else
#define HAVE_MMAP 1
#endif

3. A multitude of lines of form
#defined SOMELINE\
were changed to form
#define SOMELINE \

to compile successfully with Clang.

The second commit removes the test for contiguous linear memory allocation addresses in test_dlmalloc.c for OSX. This succeeds/fails randomly on OSX, and it's most likely just behavior that is not guaranteed on the platform.