LLVM  16.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. More...
 
virtual char * prepare (ExecutorAddr Addr, size_t ContentSize)=0
 Provides working memory. More...
 
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. More...
 
virtual void deinitialize (ArrayRef< ExecutorAddr > Allocations, OnDeinitializedFunction OnDeInitialized)=0
 Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed. More...
 
virtual void release (ArrayRef< ExecutorAddr > Reservations, OnReleasedFunction OnRelease)=0
 Release address space acquired through reserve() More...
 
virtual ~MemoryMapper ()
 

Detailed Description

Manages mapping, content transfer and protections for JIT memory.

Definition at line 25 of file MemoryMapper.h.

Member Typedef Documentation

◆ OnDeinitializedFunction

Definition at line 65 of file MemoryMapper.h.

◆ OnInitializedFunction

Definition at line 54 of file MemoryMapper.h.

◆ OnReleasedFunction

Definition at line 72 of file MemoryMapper.h.

◆ OnReservedFunction

Definition at line 43 of file MemoryMapper.h.

Constructor & Destructor Documentation

◆ ~MemoryMapper()

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

Definition at line 27 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::SharedMemoryMapper, and llvm::orc::InProcessMemoryMapper.

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

◆ prepare()

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

Provides working memory.

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

◆ release()

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

Release address space acquired through reserve()

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

◆ reserve()

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

Reserves address space in executor process.

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


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