summaryrefslogtreecommitdiff
path: root/orc-rt/lib/executor/SimpleNativeMemoryMap.cpp
AgeCommit message (Collapse)Author
2025-10-13[orc-rt] Rename InitializeRequest variables after 7381558ef8b. NFCI.Lang Hames
7381558ef8b renamed the FinalizeRequest type to InitializeRequest. This commit updates InitializeRequest variable names to follow suit ("FR"s become "IR"s).
2025-10-13[orc-rt] Rename SimpleNativeMemoryMap finalize & deallocate. NFCI. (#163114)Lang Hames
This commit renames the "finalize" operation to "initialize", and "deallocate" to "deinitialize". The new names are chosen to better fit the point of view of the ORC-runtime and executor-process: After memory is *reserved* it can be *initialized* with some content, and *deinitialized* to return that memory to the reserved region. This seems more understandable to me than the original scheme, which named these operations after the controller-side JITLinkMemoryManager operations that they partially implemented. I.e. SimpleNativeMemoryMap::finalize implemented the final step of JITLinkMemoryManager::finalize, initializing the memory in the executor; and SimpleNativeMemoryMap::deallocate implemented the final step of JITLinkMemoryManager::deallocate, running dealloc actions and releasing the finalized region. The proper way to think of the relationship between these operations now is that: 1. The final step of finalization is to initialize the memory in the executor. 2. The final step of deallocation is to deinitialize the memory in the executor.
2025-10-12[orc-rt] Add multi-addr dealloc/release to SimpleNativeMemoryMap. (#163025)Lang Hames
In an ORC JIT it's common for multiple memory regions to be deallocated at once, e.g. when a ResourceTracker covering multiple object files is removed. This commit adds SimpleNativeMemoryMap::deallocateMultiple and SimpleNativeMemoryMap::releaseMultiple APIs that can be used to reduce the number of calls (and consequently IPC messages in cross-process setups) in these cases. Adding these operations will make it easier to write an llvm::orc::MemoryMapper class that can use SimpleNativeMemoryMap as a backend.
2025-10-11[orc-rt] Align SimpleNativeMemoryMap Segment with LLVM type. (#162823)Lang Hames
This commit aims to align SimpleNativeMemoryMap::FinalizeRequest::Segment with llvm::orc::tpctypes::SegFinalizeRequest. This will simplify construction of a new LLVM JITLinkMemoryManager that's capable of using SimpleNativeMemoryMap as a backend.
2025-10-09[orc-rt] Add SimpleNativeMemoryMap. (#162584)Lang Hames
SimpleNativeMemoryMap is a memory allocation backend for use with ORC. It can... 1. Reserve slabs of address space. 2. Finalize regions of memory within a reserved slab: copying content into requested addresses, applying memory protections, running finalization actions, and storing deallocation actions to be run by deallocate. 3. Deallocate finalized memory regions: running deallocate actions and, if possible, making memory in these regions available for use by future finalization operations. (Some systems prohibit reuse of executable memory. On these systems deallocated memory is no longer usable within the process). 4. Release reserved slabs. This runs deallocate for any not-yet-deallocated finalized regions, and then (if possible) returns the address space to system. (On systems that prohibit reuse of executable memory parts of the released address space may be permanently unusable by the process). SimpleNativeMemoryMap is intended primarily for use by llvm::orc::JITLinkMemoryManager implementations to allocate JIT'd code and data.