Files
mercury/tests/hard_coded/thread_sbrk.exp
Peter Wang a87ee2a7a9 Use mmap for Boehm GC in threaded grades on Linux.
The glibc implementation of malloc (commonly used on Linux) can use sbrk
to acquire more memory, and so does Boehm GC in its default configuration
on Linux.  When both allocators are invoked simultaneously from different
threads then memory corruption may result.

configure.ac:
	Add --enable-gc-mmap option.

	Make --enable-gc-munmap imply --enable-gc-mmap.

	Detect mmap and set MR_HAVE_MMAP.

	Detect sbrk and set MR_HAVE_SBRK.

	On Linux (and potentially other platforms), build Boehm GC for
	threaded grades with -DUSE_MMAP if mmap was found.

Mmake.common.in:
	Add ENABLE_BOEHM_USE_MMAP.

runtime/mercury_conf.h.in:
	Add MR_HAVE_MMAP, although it is not used anywhere yet.

	Add MR_HAVE_SBRK.  It is only for used by the test program.

tests/hard_coded/Mmakefile:
tests/hard_coded/thread_sbrk.exp:
tests/hard_coded/thread_sbrk.exp2:
tests/hard_coded/thread_sbrk.m:
	Add test program.

NEWS:
	Announce changes.

(cherry picked from commit d63a294e1f)
2014-08-29 13:44:15 +10:00

22 lines
391 B
Plaintext

depth 1, size 1
depth 2, size 3
depth 3, size 7
depth 4, size 15
depth 5, size 31
depth 6, size 63
depth 7, size 127
depth 8, size 255
depth 9, size 511
depth 10, size 1023
depth 11, size 2047
depth 12, size 4095
depth 13, size 8191
depth 14, size 16383
depth 15, size 32767
depth 16, size 65535
depth 17, size 131071
depth 18, size 262143
depth 19, size 524287
depth 20, size 1048575
done.