LLVM 22.0.0git
|
Manages mapping, content transfer and protections for JIT memory. More...
#include "llvm/ExecutionEngine/Orc/MemoryMapper.h"
Classes | |
struct | AllocInfo |
Represents a single allocation containing multiple segments and initialization and deinitialization actions. More... |
Public Types | |
using | OnReservedFunction = unique_function<void(Expected<ExecutorAddrRange>)> |
using | OnInitializedFunction = unique_function<void(Expected<ExecutorAddr>)> |
using | OnDeinitializedFunction = unique_function<void(Error)> |
using | OnReleasedFunction = unique_function<void(Error)> |
Public Member Functions | |
virtual unsigned int | getPageSize ()=0 |
virtual void | reserve (size_t NumBytes, OnReservedFunction OnReserved)=0 |
Reserves address space in executor process. | |
virtual char * | prepare (jitlink::LinkGraph &G, ExecutorAddr Addr, size_t ContentSize)=0 |
Provides working memory The LinkGraph parameter is included to allow implementations to allocate working memory from the LinkGraph's allocator, in which case it will be deallocated when the LinkGraph is destroyed. | |
virtual void | initialize (AllocInfo &AI, OnInitializedFunction OnInitialized)=0 |
Ensures executor memory is synchronized with working copy memory, sends functions to be called after initilization and before deinitialization and applies memory protections Returns a unique address identifying the allocation. | |
virtual void | deinitialize (ArrayRef< ExecutorAddr > Allocations, OnDeinitializedFunction OnDeInitialized)=0 |
Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed. | |
virtual void | release (ArrayRef< ExecutorAddr > Reservations, OnReleasedFunction OnRelease)=0 |
Release address space acquired through reserve() | |
virtual | ~MemoryMapper () |
Manages mapping, content transfer and protections for JIT memory.
Definition at line 27 of file MemoryMapper.h.
using llvm::orc::MemoryMapper::OnDeinitializedFunction = unique_function<void(Error)> |
Definition at line 71 of file MemoryMapper.h.
using llvm::orc::MemoryMapper::OnInitializedFunction = unique_function<void(Expected<ExecutorAddr>)> |
Definition at line 60 of file MemoryMapper.h.
using llvm::orc::MemoryMapper::OnReleasedFunction = unique_function<void(Error)> |
Definition at line 78 of file MemoryMapper.h.
using llvm::orc::MemoryMapper::OnReservedFunction = unique_function<void(Expected<ExecutorAddrRange>)> |
Definition at line 45 of file MemoryMapper.h.
|
virtual |
Definition at line 30 of file MemoryMapper.cpp.
|
pure virtual |
Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed.
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.
|
pure virtual |
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.
|
pure virtual |
Ensures executor memory is synchronized with working copy memory, sends functions to be called after initilization and before deinitialization and applies memory protections Returns a unique address identifying the allocation.
This address should be passed to deinitialize to run deallocation actions (and reset permissions where possible).
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.
|
pure virtual |
Provides working memory The LinkGraph parameter is included to allow implementations to allocate working memory from the LinkGraph's allocator, in which case it will be deallocated when the LinkGraph is destroyed.
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.
References G.
|
pure virtual |
Release address space acquired through reserve()
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.
|
pure virtual |
Reserves address space in executor process.
Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.