LLVM 20.0.0git
|
Manages allocations of JIT memory. More...
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
Classes | |
class | FinalizedAlloc |
Represents a finalized allocation. More... | |
class | InFlightAlloc |
Represents an allocation which has not been finalized yet. More... | |
Public Types | |
using | AllocResult = Expected< std::unique_ptr< InFlightAlloc > > |
Typedef for the argument to be passed to OnAllocatedFunction. | |
using | OnAllocatedFunction = unique_function< void(AllocResult)> |
Called when allocation has been completed. | |
using | OnDeallocatedFunction = unique_function< void(Error)> |
Called when deallocation has completed. | |
Public Member Functions | |
virtual | ~JITLinkMemoryManager () |
virtual void | allocate (const JITLinkDylib *JD, LinkGraph &G, OnAllocatedFunction OnAllocated)=0 |
Start the allocation process. | |
AllocResult | allocate (const JITLinkDylib *JD, LinkGraph &G) |
Convenience function for blocking allocation. | |
virtual void | deallocate (std::vector< FinalizedAlloc > Allocs, OnDeallocatedFunction OnDeallocated)=0 |
Deallocate a list of allocation objects. | |
void | deallocate (FinalizedAlloc Alloc, OnDeallocatedFunction OnDeallocated) |
Convenience function for deallocation of a single alloc. | |
Error | deallocate (std::vector< FinalizedAlloc > Allocs) |
Convenience function for blocking deallocation. | |
Error | deallocate (FinalizedAlloc Alloc) |
Convenience function for blocking deallocation of a single alloc. | |
Manages allocations of JIT memory.
Instances of this class may be accessed concurrently from multiple threads and their implemetations should include any necessary synchronization.
Definition at line 43 of file JITLinkMemoryManager.h.
using llvm::jitlink::JITLinkMemoryManager::AllocResult = Expected<std::unique_ptr<InFlightAlloc> > |
Typedef for the argument to be passed to OnAllocatedFunction.
Definition at line 143 of file JITLinkMemoryManager.h.
Called when allocation has been completed.
Definition at line 146 of file JITLinkMemoryManager.h.
Called when deallocation has completed.
Definition at line 149 of file JITLinkMemoryManager.h.
|
virtualdefault |
|
inline |
Convenience function for blocking allocation.
Definition at line 163 of file JITLinkMemoryManager.h.
References llvm::Alloc, allocate(), and G.
|
pure virtual |
Start the allocation process.
If the initial allocation is successful then the OnAllocated function will be called with a std::unique_ptr<InFlightAlloc> value. If the assocation is unsuccessful then the OnAllocated function will be called with an Error.
Implemented in llvm::orc::EPCGenericJITLinkMemoryManager, llvm::orc::MapperJITLinkMemoryManager, llvm::jitlink::InProcessMemoryManager, and llvm::jitlink::InProcessMemoryManager.
Referenced by allocate(), and llvm::jitlink::SimpleSegmentAlloc::Create().
|
inline |
Convenience function for blocking deallocation of a single alloc.
Definition at line 196 of file JITLinkMemoryManager.h.
References llvm::Alloc, and deallocate().
|
inline |
Convenience function for deallocation of a single alloc.
Definition at line 180 of file JITLinkMemoryManager.h.
References llvm::Alloc, and deallocate().
|
inline |
Convenience function for blocking deallocation.
Definition at line 187 of file JITLinkMemoryManager.h.
References deallocate().
|
pure virtual |
Deallocate a list of allocation objects.
Dealloc actions will be run in reverse order (from the end of the vector to the start).
Implemented in llvm::jitlink::InProcessMemoryManager, llvm::orc::EPCGenericJITLinkMemoryManager, llvm::orc::MapperJITLinkMemoryManager, and llvm::jitlink::InProcessMemoryManager.
Referenced by deallocate(), llvm::orc::ObjectLinkingLayerJITLinkContext::notifyEmitted(), and llvm::orc::DebugObject::~DebugObject().