LLVM 22.0.0git
llvm::orc::MemoryMapper Class Referenceabstract

Manages mapping, content transfer and protections for JIT memory. More...

#include "llvm/ExecutionEngine/Orc/MemoryMapper.h"

Inheritance diagram for llvm::orc::MemoryMapper:
[legend]

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 charprepare (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 ()

Detailed Description

Manages mapping, content transfer and protections for JIT memory.

Definition at line 27 of file MemoryMapper.h.

Member Typedef Documentation

◆ OnDeinitializedFunction

◆ OnInitializedFunction

◆ OnReleasedFunction

◆ OnReservedFunction

Constructor & Destructor Documentation

◆ ~MemoryMapper()

llvm::orc::MemoryMapper::~MemoryMapper ( )
virtual

Definition at line 30 of file MemoryMapper.cpp.

Member Function Documentation

◆ deinitialize()

virtual void llvm::orc::MemoryMapper::deinitialize ( ArrayRef< ExecutorAddr > Allocations,
OnDeinitializedFunction OnDeInitialized )
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.

◆ getPageSize()

virtual unsigned int llvm::orc::MemoryMapper::getPageSize ( )
pure virtual

◆ initialize()

virtual void llvm::orc::MemoryMapper::initialize ( AllocInfo & AI,
OnInitializedFunction OnInitialized )
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.

◆ prepare()

virtual char * llvm::orc::MemoryMapper::prepare ( jitlink::LinkGraph & G,
ExecutorAddr Addr,
size_t ContentSize )
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.

◆ release()

virtual void llvm::orc::MemoryMapper::release ( ArrayRef< ExecutorAddr > Reservations,
OnReleasedFunction OnRelease )
pure virtual

◆ reserve()

virtual void llvm::orc::MemoryMapper::reserve ( size_t NumBytes,
OnReservedFunction OnReserved )
pure virtual

Reserves address space in executor process.

Implemented in llvm::orc::InProcessMemoryMapper, llvm::orc::SharedMemoryMapper, and llvm::orc::SimpleRemoteMemoryMapper.


The documentation for this class was generated from the following files: