[LLVMdev] LLVM+OCaml Bindings for the latest LLVM is slower than 2.6

Jon Harrop jon at ffconsultancy.com
Wed Feb 17 23:00:22 PST 2010


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



More information about the llvm-dev mailing list