liangfu commented on a change in pull request #7406:
URL: https://github.com/apache/tvm/pull/7406#discussion_r576530859
##########
File path: src/runtime/contrib/verilator/verilator_runtime.cc
##########
@@ -76,19 +76,24 @@ VerilatorProfiler* VerilatorProfiler::ThreadLocal() {
return &inst;
}
-void VerilatorRuntime::LoadLibrary(const std::string& lib_name) {
- lib_ = new VerilatorLibrary();
- lib_->Load(lib_name);
+VerilatorRuntime::~VerilatorRuntime() {
+ auto dealloc =
reinterpret_cast<VerilatorDeallocFunc>(lib_->GetSymbol("VerilatorDealloc"));
+ ICHECK(dealloc != nullptr);
+ dealloc(device_);
+ lib_->~VerilatorLibrary();
Review comment:
just out of curiosity, why do we explicitly call the deallocator instead
of `delete lib_`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]