LLVM 20.0.0git
|
#include "llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h"
Classes | |
class | InFlightAlloc |
Public Member Functions | |
MapperJITLinkMemoryManager (size_t ReservationGranularity, std::unique_ptr< MemoryMapper > Mapper) | |
void | allocate (const jitlink::JITLinkDylib *JD, jitlink::LinkGraph &G, OnAllocatedFunction OnAllocated) override |
Start the allocation process. | |
void | deallocate (std::vector< FinalizedAlloc > Allocs, OnDeallocatedFunction OnDeallocated) override |
Deallocate a list of allocation objects. | |
Public Member Functions inherited from llvm::jitlink::JITLinkMemoryManager | |
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. | |
Static Public Member Functions | |
template<class MemoryMapperType , class... Args> | |
static Expected< std::unique_ptr< MapperJITLinkMemoryManager > > | CreateWithMapper (size_t ReservationGranularity, Args &&...A) |
Additional Inherited Members | |
Public Types inherited from llvm::jitlink::JITLinkMemoryManager | |
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. | |
Definition at line 23 of file MapperJITLinkMemoryManager.h.
llvm::orc::MapperJITLinkMemoryManager::MapperJITLinkMemoryManager | ( | size_t | ReservationGranularity, |
std::unique_ptr< MemoryMapper > | Mapper | ||
) |
Definition at line 57 of file MapperJITLinkMemoryManager.cpp.
|
overridevirtual |
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.
Implements llvm::jitlink::JITLinkMemoryManager.
Definition at line 62 of file MapperJITLinkMemoryManager.cpp.
References llvm::alignTo(), End, G, llvm::sys::SmartMutex< mt_only >::lock(), llvm::orc::Result, and llvm::sys::SmartMutex< mt_only >::unlock().
|
inlinestatic |
Definition at line 30 of file MapperJITLinkMemoryManager.h.
References A.
|
overridevirtual |
Deallocate a list of allocation objects.
Dealloc actions will be run in reverse order (from the end of the vector to the start).
Implements llvm::jitlink::JITLinkMemoryManager.
Definition at line 147 of file MapperJITLinkMemoryManager.cpp.
References Addr, Size, and llvm::Error::success().