[PATCH] D127491: [JITLink][Orc] Add MemoryMapper interface with InProcess implementation

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 03:32:51 PDT 2022


sgraenitz added inline comments.


================
Comment at: llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h:55
+  /// applies memory protections
+  /// Returns minimum address of all the segments as an unique identifier for
+  /// the allocation
----------------
argentite wrote:
> lhames wrote:
> > I think we want to keep the contract on the address returned by `initialize` loose:
> > ```
> > /// Returns a unique address identifying the allocation. This address should
> > /// be passed to deinitialize to run deallocation actions (and reset permissions
> > /// where possible).
> > ```
> > The `InProcessAllocator` uses the lowest allocated address as a key into a DenseMap, but you could imagine schemes that return a pointer to a bookkeeping struct instead.
> Should we reset permissions? And if so what should we reset to? PROT_NONE?
No, I don't think so. None of the other uses of `releaseMappedMemory()` in LLVM does it. And if it's relevant for a use-case it could always be done in a dealloc action right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127491/new/

https://reviews.llvm.org/D127491



More information about the llvm-commits mailing list