LLVM 20.0.0git
Classes | Public Types | Public Member Functions | List of all members
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:
Inheritance graph
[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 (ExecutorAddr Addr, size_t ContentSize)=0
 Provides working memory.
 
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 26 of file MemoryMapper.h.

Member Typedef Documentation

◆ OnDeinitializedFunction

Definition at line 66 of file MemoryMapper.h.

◆ OnInitializedFunction

Definition at line 55 of file MemoryMapper.h.

◆ OnReleasedFunction

Definition at line 73 of file MemoryMapper.h.

◆ OnReservedFunction

Definition at line 44 of file MemoryMapper.h.

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, and llvm::orc::SharedMemoryMapper.

◆ 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, and llvm::orc::SharedMemoryMapper.

◆ prepare()

virtual char * llvm::orc::MemoryMapper::prepare ( ExecutorAddr  Addr,
size_t  ContentSize 
)
pure virtual

Provides working memory.

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

◆ release()

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

Release address space acquired through reserve()

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

◆ 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, and llvm::orc::SharedMemoryMapper.


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