1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Defer specialized module deletion

This commit is contained in:
Brian Fiete 2022-05-16 15:21:59 -07:00
parent 67329ac774
commit 347dc5b8cf
3 changed files with 28 additions and 10 deletions

View file

@ -1798,7 +1798,7 @@ void BfContext::DeleteType(BfType* type, bool deferDepRebuilds)
// This was only needed for 'zombie modules', which we don't need anymore?
// To avoid linking errors. Used instead of directly removing from mModules.
mDeletingModules.push_back(module);
mDeletingModules.Add(module);
}
}
}
@ -3187,7 +3187,7 @@ void BfContext::MarkUsedModules(BfProject* project, BfModule* module)
{
BP_ZONE("BfContext::MarkUsedModules");
BF_ASSERT(!module->mIsDeleting);
BF_ASSERT_REL(!module->mIsDeleting);
if (module->mIsScratchModule)
return;
@ -3316,10 +3316,15 @@ void BfContext::Cleanup()
{
for (auto itr = project->mUsedModules.begin(); itr != project->mUsedModules.end(); )
{
if ((*itr)->mIsDeleting)
auto module = *itr;
if (module->mIsDeleting)
itr = project->mUsedModules.Remove(itr);
else
{
BF_ASSERT_REL(module->mRevision > -2);
++itr;
}
}
}
}