[PATCH] D12607: [ExecutionEngine] Add to the C API possibility to create custom SectionMemoryManager

Richard Diamond via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 19:23:09 PDT 2015


DiamondLovesYou added a subscriber: DiamondLovesYou.
DiamondLovesYou added a reviewer: DiamondLovesYou.

================
Comment at: include/llvm-c/ExecutionEngine.h:214
@@ +213,3 @@
+typedef LLVMBool (*LLVMBSMMFinalizeMemoryCallback)(
+  void *Opaque, LLVMMCJITMemoryManagerRef MM, char **ErrMsg);
+typedef void     (*LLVMBSMMDestroyCallback)(void *Opaque);
----------------
What will `ErrMsg`'s lifetime be (or who owns it after the callback returns)? Also, how would use of `alloc_jemalloc` affect this (w.r.t. Rust)?

================
Comment at: include/llvm-c/ExecutionEngine.h:223
@@ +222,3 @@
+ * Create a simple custom MCJIT memory manager based on SectionMemoryManager.
+ * If any of passed functions in NULL, appropriate method from the parrent class
+ * (SectionMemoryManager) will be called.
----------------
Typos

================
Comment at: include/llvm-c/ExecutionEngine.h:225
@@ +224,3 @@
+ * (SectionMemoryManager) will be called.
+ * Every callback receives an opaque pointer to client object and a pointer to the
+ * memory manager object, so it can call methods from the parent class.
----------------
*to the client object

================
Comment at: lib/ExecutionEngine/ExecutionEngineBindings.cpp:450
@@ -449,2 +643,1 @@
 }
-
----------------
Keep this line.


http://reviews.llvm.org/D12607





More information about the llvm-commits mailing list