Commit 29ec96c8 authored by Simon Marlow's avatar Simon Marlow Committed by pcapriotti
Browse files

OS X: use mmap() instead of malloc for allocating the bss (#7040)

MERGED from commit e590ad77
parent 702f0db0
......@@ -6147,8 +6147,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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment