LLVM  16.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

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 118 of file JITLinkMemoryManager.h.

Member Typedef Documentation

◆ OnAbandonedFunction

Definition at line 121 of file JITLinkMemoryManager.h.

◆ OnFinalizedFunction

Definition at line 120 of file JITLinkMemoryManager.h.

Constructor & Destructor Documentation

◆ ~InFlightAlloc()

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

Member Function Documentation

◆ abandon()

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

◆ finalize() [1/2]

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

Synchronous convenience version of finalize.

Definition at line 132 of file JITLinkMemoryManager.h.

References move.

◆ finalize() [2/2]

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

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