search for: getnummodul

Displaying 3 results from an estimated 3 matches for "getnummodul".

Did you mean: getnummodules
2018 Sep 15
4
LLVMContext: Threads and Ownership.
...iling layer of the JIT we could have something like: // Compile finished, time to deallocate the module. // Explicit deletes used for clarity, we would use unique_ptrs in practice. auto &Ctx = Mod->getContext(); delete Mod; std::lock_guard<std::mutex> Lock(Ctx->getMutex()); if (Ctx.getNumModules()) delete Ctx; Another option would be to invert the ownership model and say that each Module shares ownership of its LLVMContext. That way LLVMContexts would be automatically deallocated when the last module using them is destructed (providing no other shared_ptrs to the context are held else...
2018 Sep 16
2
LLVMContext: Threads and Ownership.
...// Compile finished, time to deallocate the module. >> // Explicit deletes used for clarity, we would use unique_ptrs in >> practice. >> auto &Ctx = Mod->getContext(); >> delete Mod; >> std::lock_guard<std::mutex> Lock(Ctx->getMutex()); >> if (Ctx.getNumModules()) >> delete Ctx; >> >> Another option would be to invert the ownership model and say that each >> Module shares ownership of its LLVMContext. That way LLVMContexts would be >> automatically deallocated when the last module using them is destructed >> (provid...
2018 Sep 16
2
LLVMContext: Threads and Ownership.
...le. >>>> // Explicit deletes used for clarity, we would use unique_ptrs in >>>> practice. >>>> auto &Ctx = Mod->getContext(); >>>> delete Mod; >>>> std::lock_guard<std::mutex> Lock(Ctx->getMutex()); >>>> if (Ctx.getNumModules()) >>>> delete Ctx; >>>> >>>> Another option would be to invert the ownership model and say that each >>>> Module shares ownership of its LLVMContext. That way LLVMContexts would be >>>> automatically deallocated when the last module u...