Jianzhou Zhao
2010-Feb-16 18:29 UTC
[LLVMdev] LLVM+OCaml Bindings for the latest LLVM is slower than 2.6
LLVM-2.6 takes 3s from OCamlbuild, but the lastest LLVM (I am using r95712) takes 34s. I attached the code. But the new LLVM fixed a problem of dispose_module in 2.6. I got this error in 2.6, but the new LLVM works well. While deleting: [14 x i8]* %greeting An asserting value handle still pointed to this value! UNREACHABLE executed at /mnt/eclipse/acg/users/jianzhou/download/llvm-2.6/lib/VMCore/Value.cpp:492! Aborted I had some problem to debug assertions in C++ from OCaml, so did not figure out the root cause yet. But it is fixed anyway. Do we need to expliciltly release (dispose_module) a module in OCaml at the end of a program? The C++ tutorial does not call dispose_module in C++. When should I use this interface? Thanks Jianzhou -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.ml Type: application/octet-stream Size: 1353 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100216/35a1483e/attachment.obj>
Jon Harrop
2010-Feb-18 07:00 UTC
[LLVMdev] LLVM+OCaml Bindings for the latest LLVM is slower than 2.6
On Tuesday 16 February 2010 18:29:16 Jianzhou Zhao wrote:> Do we need to expliciltly release (dispose_module) a module in OCaml > at the end of a program?Provided that is just manual memory management leaked into OCaml from the C++ side, the sane thing to do would be to wrap the module in an object and give it a finalizer that called dispose_module when OCaml's GC collected the object. The only non-trivial aspect is making sure that the OCaml representation of the module keeps references to anything that refers back to it on the C++ side to ensure that it is not prematurely collected. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e