[PATCH] Expose custom MC-JIT memory allocation through the C API

Filip Pizlo fpizlo at apple.com
Thu May 16 09:41:13 PDT 2013


Updated patch:

- Fixed misspellings in ExecutionEngine.h
- Backed out the RuntimeDyldMachO.cpp change, which was part of an unrelated patch.

-Filip



On May 15, 2013, at 6:58 PM, Filip Pizlo <fpizlo at apple.com> wrote:

> This patch allows a C API client to supply their own memory manager.
> 
> My main motivation for this is: https://bugs.webkit.org/show_bug.cgi?id=113619.  WebKit wants to use the C API, since it's more stable.  WebKit already has its own JIT memory management and cache management logic, and we need LLVM to allocate from WebKit's JIT memory pool.
> 
> To make this work without causing dependency issues, the dummy destructor for RTDyldMemoryManager is moved into libLLVMExecutionEngine, and it's also now in its own header.  This allows ExecutionEngineBindings to speak of RTDyldMemoryManager.
> 
> The memory manager API is exposed as callbacks in the LLVMMCJITMemoryManagerFunctions struct.  The user is allowed to leave most of the functions NULL, and reasonable defaults are provided.
> 
> This patch also adds a test of the memory manager API, by round-tripping through the C API callback back into the SectionMemoryManager.
> 
> -Filip
> 
> <mcjmm-c.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130516/7bf5fb13/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcjmm-c.patch
Type: application/octet-stream
Size: 27072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130516/7bf5fb13/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130516/7bf5fb13/attachment-0001.html>


More information about the llvm-commits mailing list