is it possible to reclaim memory resources from a llvmContext?
since llvm 2.7, it is possible to isolate Types and anything that LLVM might need to create a JIT module inside a llvmContext
however, i am not entirely clear how to reclaim memory resources internally allocated in a llvmContext once it has been used. I think there should be one since the point of using llvmContext is to use them safely from other threads that do not share any depende开发者_如何学Goncies, but threads start and finish periodically and continually creating new llvmContexts will eventually consume all the available RAM
Yes, LLVMContext's destructor will free all its memory. If it's not, please file a bug, http://llvm.org/bugs ! Of course, don't destruct the global one :-)
If you're shutting down, you can also call llvm::llvm_shutdown() which frees global static variables. Note that there's no llvm_startup function or anything like that ...
精彩评论