LLVM 20.0.0git
|
A utility class for making simple allocations using JITLinkMemoryManager. More...
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
Classes | |
struct | Segment |
Describes a segment to be allocated. More... | |
struct | SegmentInfo |
Describes the segment working memory and executor address. More... | |
Public Types | |
using | SegmentMap = orc::AllocGroupSmallMap< Segment > |
using | OnCreatedFunction = unique_function< void(Expected< SimpleSegmentAlloc >)> |
using | OnFinalizedFunction = JITLinkMemoryManager::InFlightAlloc::OnFinalizedFunction |
Public Member Functions | |
SimpleSegmentAlloc (SimpleSegmentAlloc &&) | |
SimpleSegmentAlloc & | operator= (SimpleSegmentAlloc &&) |
~SimpleSegmentAlloc () | |
SegmentInfo | getSegInfo (orc::AllocGroup AG) |
Returns the SegmentInfo for the given group. | |
void | finalize (OnFinalizedFunction OnFinalized) |
Finalize all groups (async version). | |
Expected< JITLinkMemoryManager::FinalizedAlloc > | finalize () |
Finalize all groups. | |
Static Public Member Functions | |
static void | Create (JITLinkMemoryManager &MemMgr, const JITLinkDylib *JD, SegmentMap Segments, OnCreatedFunction OnCreated) |
static Expected< SimpleSegmentAlloc > | Create (JITLinkMemoryManager &MemMgr, const JITLinkDylib *JD, SegmentMap Segments) |
A utility class for making simple allocations using JITLinkMemoryManager.
SimpleSegementAlloc takes a mapping of AllocGroups to Segments and uses this to create a LinkGraph with one Section (containing one Block) per Segment. Clients can obtain a pointer to the working memory and executor address of that block using the Segment's AllocGroup. Once memory has been populated, clients can call finalize to finalize the memory.
Note: Segments with MemLifetime::NoAlloc are not permitted, since they would not be useful, and their presence is likely to indicate a bug.
Definition at line 297 of file JITLinkMemoryManager.h.
using llvm::jitlink::SimpleSegmentAlloc::OnCreatedFunction = unique_function<void(Expected<SimpleSegmentAlloc>)> |
Definition at line 317 of file JITLinkMemoryManager.h.
using llvm::jitlink::SimpleSegmentAlloc::OnFinalizedFunction = JITLinkMemoryManager::InFlightAlloc::OnFinalizedFunction |
Definition at line 319 of file JITLinkMemoryManager.h.
Definition at line 315 of file JITLinkMemoryManager.h.
|
default |
|
default |
|
static |
Definition at line 204 of file JITLinkMemoryManager.cpp.
References Create().
|
static |
Definition at line 146 of file JITLinkMemoryManager.cpp.
References llvm::alignTo(), llvm::jitlink::JITLinkMemoryManager::allocate(), assert(), B, llvm::orc::ExecutorAddr::getValue(), llvm::native, llvm::orc::NoAlloc, and llvm::orc::AllocGroup::NumGroups.
Referenced by Create(), and llvm::orc::ELFDebugObject::finalizeWorkingMemory().
|
inline |
Finalize all groups.
Definition at line 342 of file JITLinkMemoryManager.h.
|
inline |
Finalize all groups (async version).
Definition at line 337 of file JITLinkMemoryManager.h.
SimpleSegmentAlloc::SegmentInfo llvm::jitlink::SimpleSegmentAlloc::getSegInfo | ( | orc::AllocGroup | AG | ) |
Returns the SegmentInfo for the given group.
Definition at line 221 of file JITLinkMemoryManager.cpp.
|
default |