summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/MapperJITLinkMemoryManager.cpp
AgeCommit message (Collapse)Author
2025-03-31[ORC] MapperJITLinkMemoryManager should deinitialize on abandon, not deallocate.Lang Hames
The JITLinkMemoryManager::InFlightAlloc::abandon method should only abandon memory for the current allocation, not any other allocations. In MapperJITLinkMemoryManager this corresponds to the deinitialize operation, not the deallocate operation (which releases whole slabs of memory that may be shared by many allocations). No testcase: This was spotted by inspection. The failing program was linking concurrently when one linker instance raised an error. Through the call to abandon an entire underlying slab was deallocated, resulting in segfaults in other concurrent links that were sharing that slab.
2024-11-19[ExecutionEngine] Remove unused includes (NFC) (#116749)Kazu Hirata
Identified with misc-include-cleaner.
2022-10-03[ORC][JITLink] Move MemoryFlags.h (MemProt, AllocGroup,...) from JITLink to ORC.Lang Hames
Moving these types to OrcShared eliminates the need for the separate WireProtectionFlags type.
2022-09-16[ORC][ORC-RT][MachO] Reset __data and __common sections on library close.Lang Hames
If we want to be able to close and then re-open a library then we need to reset the data section states when the library is closed. This commit updates MachOPlatform and the ORC runtime to track __data and __common sections, and reset the state in MachOPlatformRuntimeState::dlcloseDeinitialize. This is only a first step to full support -- there are other data sections that we're not capturing, and we'll probably want a more efficient representation for the sections (rather than passing their string name over IPC), but this is a reasonable first step. This commit also contains a fix to MapperJITLinkMemoryManager that prevents it from calling OnDeallocated twice in the case of an error.
2022-08-21[Orc] Actually save the callbackAnubhab Ghosh
The callback function was captured by reference but it lived on the stack and was in danger of being overwritten and could cause a crash. Differential Revision: https://reviews.llvm.org/D132313
2022-08-14[Orc] Use IntervalMap to store free memory regions in MapperJITLinkMemoryManagerAnubhab Ghosh
MapperJITLinkMemoryManager uses a free list to keep track of available memory regions. Using an IntervalMap instead of vector allow automatic coalescing of memory regions as they are freed. Differential Revision: https://reviews.llvm.org/D131831
2022-08-13Reapply [Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManagerAnubhab Ghosh
When memory is deallocated from MapperJITLinkMemoryManager deinitialize actions are run through mapper and in case of InProcessMapper, memory protections of the region are reset to read/write as they were previously changed and can be reused in future. Differential Revision: https://reviews.llvm.org/D131768
2022-08-13Revert "[Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManager"Anubhab Ghosh
This reverts commit 143555b2ed30746fbcc8ff84e9cef4267688f110.
2022-08-13[Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManagerAnubhab Ghosh
When memory is deallocated from MapperJITLinkMemoryManager deinitialize actions are run through mapper and in case of InProcessMapper, memory protections of the region are reset to read/write as they were previously changed and can be reused in future. Differential Revision: https://reviews.llvm.org/D131768
2022-08-08[Orc][JITLink] Slab based memory allocator to reduce RPC callsAnubhab Ghosh
Calling reserve() used to require an RPC call. This commit allows large ranges of executor address space to be reserved. Subsequent calls to reserve() will return subranges of already reserved address space while there is still space available. Differential Revision: https://reviews.llvm.org/D130392
2022-07-20[ORC] Add a new MemoryMapper-based JITLinkMemoryManager implementation.Anubhab Ghosh
MapperJITLinkMemoryManager supports executor memory management using any implementation of MemoryMapper to do the transfer such as InProcessMapper or SharedMemoryMapper. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129495