Lines Matching refs:Memory
1 //===- SectionMemoryManager.cpp - Memory manager for MCJIT/RtDyld *- C++ -*-==//
10 // This file implements the section-based memory manager used by the MCJIT
50 // Look in the list of free memory regions and use a block there if one
77 // No pre-allocated free block was large enough. Allocate a new memory region.
79 // be updated later based on memory group.
84 // FIXME: Initialize the Near member for each memory group to avoid
87 sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(RequiredSize,
89 sys::Memory::MF_READ |
90 sys::Memory::MF_WRITE,
100 // Remember that we allocated this memory
111 // The allocateMappedMemory may allocate much more memory than we need. In
112 // this case, we store the unused memory as a free memory block.
130 // Make code memory executable.
132 sys::Memory::MF_READ | sys::Memory::MF_EXEC);
140 // Don't allow free memory blocks to be used after setting protection flags.
143 // Make read-only data memory read-only.
145 sys::Memory::MF_READ | sys::Memory::MF_EXEC);
153 // Read-write data memory already has the correct permissions
187 if (std::error_code EC = sys::Memory::protectMappedMemory(MB, Permissions))
211 sys::Memory::InvalidateInstructionCache(Block.base(), Block.size());
217 sys::Memory::releaseMappedMemory(Block);