[PATCH] D12607: [ExecutionEngine] Add to the C API possibility to create custom SectionMemoryManager
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 15:15:53 PDT 2015
lhames added a comment.
Hi Jauhien,
> This patch relies on these things:
>
> 1. Methods needed for memory management (already used in create mcjit)
> 2. Methods for symbol resolution
> 3. Existence of section MM and the fact that it implements mentioned methods
Point 3 is the problem: This would lock SectionMemoryManager and its behavior in as part of the stable C API. That's convenient from an implementation standpoint, but it's a problem for maintenance. We want to be able to redesign the memory management behavior in the future.
> > Are there any aspects that can't be satisfied by re-implementing SectionMemoryManager in C? (I know that may seem inconvenient, but it allows the client to remain stable, which is something SectionMemoryManager doesn't guarantee).
>
> >
>
> > I think the big missing piece at the moment is the symbol lookup support (getSymbolAddress and getSymbolAddressInDylib). If that's what you need I would prefer to add a new variant of LLVMCreateSimpleMCJITMemoryManager that also supports overloading those functions.
>
>
> Yes, this is the main reason why I needed this patch. But if we will introduce something for fixing this, we will have a dependency on the point 2 in the list above. And the fact of existence of section MM and implementation of all listed methods by it looks quite stable for me (no much of dependency of its behavior really). Or am I wrong somewhere?
I'm happy to add symbol resolution methods to the abstract C memory manager interface. The stability of SectionMemoryManager is accidental though: it's just that nobody has found time to work on it. As I said - we want to reserve the right to change that behavior in the future, so we can't expose it via the stable API.
http://reviews.llvm.org/D12607
More information about the llvm-commits
mailing list