Plug memory leaks (#5016)

This commit is contained in:
Geza Lore
2024-03-23 22:12:43 +00:00
committed by GitHub
parent 38ad328956
commit 9b729b80e0
16 changed files with 70 additions and 29 deletions
+5 -1
View File
@@ -369,8 +369,10 @@ public:
static void selfTest() {
V3Graph graph;
FileLine* const flp = v3Global.rootp()->fileline();
const auto makeBody = [flp]() {
std::vector<AstMTaskBody*> mTaskBodyps;
const auto makeBody = [&]() {
AstMTaskBody* const bodyp = new AstMTaskBody{flp};
mTaskBodyps.push_back(bodyp);
bodyp->addStmtsp(new AstComment{flp, ""});
return bodyp;
};
@@ -421,6 +423,8 @@ public:
UASSERT_SELFTEST(uint32_t, packer.completionTime(schedule, t1, 1), 1130);
UASSERT_SELFTEST(uint32_t, packer.completionTime(schedule, t2, 0), 1229);
UASSERT_SELFTEST(uint32_t, packer.completionTime(schedule, t2, 1), 1199);
for (AstNode* const nodep : mTaskBodyps) nodep->deleteTree();
}
static const ThreadSchedule apply(const V3Graph& mtaskGraph) {