14#ifndef LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H
15#define LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H
22#include <system_error>
75 unsigned Flags, std::error_code &EC) = 0;
128 bool isReadOnly)
override;
153 struct FreeMemBlock {
160 unsigned PendingPrefixIndex;
180 std::error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup,
181 unsigned Permissions);
183 void anchor()
override;
186 MemoryGroup RWDataMem;
187 MemoryGroup RODataMem;
188 MemoryMapper *MMapper;
189 std::unique_ptr<MemoryMapper> OwnedMMapper;
This file defines the SmallVector class.
Implementations of this interface are used by SectionMemoryManager to request pages from the operatin...
virtual std::error_code protectMappedMemory(const sys::MemoryBlock &Block, unsigned Flags)=0
This method sets the protection flags for a block of memory to the state specified by Flags.
virtual std::error_code releaseMappedMemory(sys::MemoryBlock &M)=0
This method releases a block of memory that was allocated with the allocateMappedMemory method.
virtual sys::MemoryBlock allocateMappedMemory(AllocationPurpose Purpose, size_t NumBytes, const sys::MemoryBlock *const NearBlock, unsigned Flags, std::error_code &EC)=0
This method attempts to allocate NumBytes bytes of virtual memory for Purpose.
This is a simple memory manager which implements the methods called by the RuntimeDyld class to alloc...
AllocationPurpose
This enum describes the various reasons to allocate pages from allocateMappedMemory.
virtual void invalidateInstructionCache()
Invalidate instruction cache for code sections.
~SectionMemoryManager() override
void operator=(const SectionMemoryManager &)=delete
uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool isReadOnly) override
Allocates a memory block of (at least) the given size suitable for executable code.
uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName) override
Allocates a memory block of (at least) the given size suitable for executable code.
SectionMemoryManager(const SectionMemoryManager &)=delete
bool finalizeMemory(std::string *ErrMsg=nullptr) override
Update section-specific memory permissions and other attributes.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
This class encapsulates the notion of a memory block which has an address and a size.
This is an optimization pass for GlobalISel generic memory operations.