[SectionMemoryManager] Don't just drop the RO free list
authorKeno Fischer <kfischer@college.harvard.edu>
Sun, 10 Jan 2016 18:17:12 +0000 (18:17 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Sun, 10 Jan 2016 18:17:12 +0000 (18:17 +0000)
In r255760, I optimized the SectionMemoryManager to make better use
of virtual memory on platforms where the allocation granularity was
bigger than the protection granularity. As part of this, fixing up
the free list became more complicated and was moved into
`applyMemoryGroupPermissions`. Unfortunately, I forgot to actually
remove the call that drops the free list for RO memory (I did
remove the corresponding one for RX memory), defeating the whole
optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257293 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/SectionMemoryManager.cpp

index e2f220862cf75812e03b83750c50ce74542de970..1ad5f1740115ba979ce35e3c9258381e7a1a8990 100644 (file)
@@ -137,9 +137,6 @@ bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg)
     return true;
   }
 
     return true;
   }
 
-  // Don't allow free memory blocks to be used after setting protection flags.
-  RODataMem.FreeMem.clear();
-
   // Make read-only data memory read-only.
   ec = applyMemoryGroupPermissions(RODataMem,
                                    sys::Memory::MF_READ | sys::Memory::MF_EXEC);
   // Make read-only data memory read-only.
   ec = applyMemoryGroupPermissions(RODataMem,
                                    sys::Memory::MF_READ | sys::Memory::MF_EXEC);