LLVM  14.0.0git
Public Types | Public Member Functions | List of all members
llvm::jitlink::JITLinkMemoryManager::InFlightAlloc Class Referenceabstract

Represents an allocation which has not been finalized yet. More...

#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"

Inheritance diagram for llvm::jitlink::JITLinkMemoryManager::InFlightAlloc:
Inheritance graph
[legend]

Public Types

using OnFinalizedFunction = unique_function< void(Expected< FinalizedAlloc >)>
 
using OnAbandonedFunction = unique_function< void(Error)>
 

Public Member Functions

virtual ~InFlightAlloc ()
 
virtual void abandon (OnAbandonedFunction OnAbandoned)=0
 Called prior to finalization if the allocation should be abandoned. More...
 
virtual void finalize (OnFinalizedFunction OnFinalized)=0
 Called to transfer working memory to the target and apply finalization. More...
 
Expected< FinalizedAllocfinalize ()
 Synchronous convenience version of finalize. More...
 

Detailed Description

Represents an allocation which has not been finalized yet.

InFlightAllocs manage both executor memory allocations and working memory allocations.

On finalization, the InFlightAlloc should transfer the content of working memory into executor memory, apply memory protections, and run any finalization functions.

Working memory should be kept alive at least until one of the following happens: (1) the InFlightAlloc instance is destroyed, (2) the InFlightAlloc is abandoned, (3) finalized target memory is destroyed.

If abandon is called then working memory and executor memory should both be freed.

Definition at line 153 of file JITLinkMemoryManager.h.

Member Typedef Documentation

◆ OnAbandonedFunction

Definition at line 156 of file JITLinkMemoryManager.h.

◆ OnFinalizedFunction

Definition at line 155 of file JITLinkMemoryManager.h.

Constructor & Destructor Documentation

◆ ~InFlightAlloc()

llvm::jitlink::JITLinkMemoryManager::InFlightAlloc::~InFlightAlloc ( )
virtualdefault

Member Function Documentation

◆ abandon()

virtual void llvm::jitlink::JITLinkMemoryManager::InFlightAlloc::abandon ( OnAbandonedFunction  OnAbandoned)
pure virtual

Called prior to finalization if the allocation should be abandoned.

Implemented in llvm::jitlink::InProcessMemoryManager::IPInFlightAlloc, and llvm::orc::EPCGenericJITLinkMemoryManager::InFlightAlloc.

◆ finalize() [1/2]

Expected<FinalizedAlloc> llvm::jitlink::JITLinkMemoryManager::InFlightAlloc::finalize ( )
inline

Synchronous convenience version of finalize.

Definition at line 167 of file JITLinkMemoryManager.h.

References move.

◆ finalize() [2/2]

virtual void llvm::jitlink::JITLinkMemoryManager::InFlightAlloc::finalize ( OnFinalizedFunction  OnFinalized)
pure virtual

Called to transfer working memory to the target and apply finalization.

Implemented in llvm::jitlink::InProcessMemoryManager::IPInFlightAlloc, and llvm::orc::EPCGenericJITLinkMemoryManager::InFlightAlloc.


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