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
49 // Look in the list of free memory regions and use a block there if one
58 // Store cutted free memory block.
65 // No pre-allocated free block was large enough. Allocate a new memory region.
67 // be updated later based on memory group.
72 // FIXME: Initialize the Near member for each memory group to avoid
75 sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(RequiredSize,
77 sys::Memory::MF_READ |
78 sys::Memory::MF_WRITE,
95 // The allocateMappedMemory may allocate much more memory than we need. In
96 // this case, we store the unused memory as a free memory block.
110 // Don't allow free memory blocks to be used after setting protection flags.
113 // Make code memory executable.
115 sys::Memory::MF_READ | sys::Memory::MF_EXEC);
123 // Don't allow free memory blocks to be used after setting protection flags.
126 // Make read-only data memory read-only.
128 sys::Memory::MF_READ | sys::Memory::MF_EXEC);
136 // Read-write data memory already has the correct permissions
153 sys::Memory::protectMappedMemory(MemGroup.AllocatedMem[i], Permissions);
164 sys::Memory::InvalidateInstructionCache(CodeMem.AllocatedMem[i].base(),
170 sys::Memory::releaseMappedMemory(CodeMem.AllocatedMem[i]);
172 sys::Memory::releaseMappedMemory(RWDataMem.AllocatedMem[i]);
174 sys::Memory::releaseMappedMemory(RODataMem.AllocatedMem[i]);