Commit e590ad77 authored by Simon Marlow's avatar Simon Marlow
Browse files

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

parent 2c60015c
......@@ -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;
}
......
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