diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-08-20 13:14:47 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-08-21 15:04:53 +0100 |
commit | e590ad77f9596a8389409ae56ea902c97e5dbfb0 (patch) | |
tree | 115a96eac9aa966979dc86dc95c7c052278f1e42 | |
parent | 2c60015cda17172629a67a7cb4441135805e1770 (diff) | |
download | haskell-e590ad77f9596a8389409ae56ea902c97e5dbfb0.tar.gz |
OS X: use mmap() instead of malloc for allocating the bss (#7040)
-rw-r--r-- | rts/Linker.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index 6d86e2b1a7..bf0045616e 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -6177,8 +6177,13 @@ ocGetNames_MachO(ObjectCode* oc) if((sections[i].flags & SECTION_TYPE) == S_ZEROFILL) { +#ifdef USE_MMAP + char * zeroFillArea = mmapForLinker(sections[i].size, MAP_ANONYMOUS, -1); + memset(zeroFillArea, 0, sections[i].size); +#else char * zeroFillArea = stgCallocBytes(1,sections[i].size, "ocGetNames_MachO(common symbols)"); +#endif sections[i].offset = zeroFillArea - image; } |