Two step allocator for 64-bit systems
authorGiovanni Campagna <gcampagn@cs.stanford.edu>
Fri, 17 Jul 2015 10:55:49 +0000 (11:55 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 22 Jul 2015 16:50:02 +0000 (17:50 +0100)
commit0d1a8d09f452977aadef7897aa12a8d41c7a4af0
tree3e8404c7f37c77b67ca913521e6890d6491f4721
parentb949c96b4960168a3b399fe14485b24a2167b982
Two step allocator for 64-bit systems

Summary:
The current OS memory allocator conflates the concepts of allocating
address space and allocating memory, which makes the HEAP_ALLOCED()
implementation excessively complicated (as the only thing it cares
about is address space layout) and slow. Instead, what we want
is to allocate a single insanely large contiguous block of address
space (to make HEAP_ALLOCED() checks fast), and then commit subportions
of that in 1MB blocks as we did before.
This is currently behind a flag, USE_LARGE_ADDRESS_SPACE, that is only enabled for
certain OSes.

Test Plan: validate

Reviewers: simonmar, ezyang, austin

Subscribers: thomie, carter

Differential Revision: https://phabricator.haskell.org/D524

GHC Trac Issues: #9706
15 files changed:
configure.ac
includes/rts/storage/MBlock.h
rts/Sparks.c
rts/posix/OSMem.c
rts/sm/BlockAlloc.c
rts/sm/GC.h
rts/sm/HeapAlloc.h [new file with mode: 0644]
rts/sm/MBlock.c
rts/sm/OSMem.h
rts/win32/OSMem.c
testsuite/tests/rts/Makefile
testsuite/tests/rts/all.T
testsuite/tests/rts/outofmem.stderr-ws-64
testsuite/tests/rts/outofmem.stdout
testsuite/tests/rts/testmblockalloc.c [new file with mode: 0644]