kern: devirtualize most things that are free to devirtualize (see #1672)

This commit is contained in:
Michael Scire 2021-10-24 13:04:31 -07:00
parent aaa3770806
commit d0cd511c0e
13 changed files with 89 additions and 89 deletions

View file

@ -528,7 +528,8 @@ namespace ams::kern {
}
/* Get the thread context. */
return this->GetThreadContextImpl(out, thread, context_flags);
static_assert(std::derived_from<KDebug, KDebugBase>);
return static_cast<KDebug *>(this)->GetThreadContextImpl(out, thread, context_flags);
}
}
@ -619,7 +620,8 @@ namespace ams::kern {
}
/* Set the thread context. */
return this->SetThreadContextImpl(ctx, thread, context_flags);
static_assert(std::derived_from<KDebug, KDebugBase>);
return static_cast<KDebug *>(this)->SetThreadContextImpl(ctx, thread, context_flags);
}
}
@ -984,6 +986,14 @@ namespace ams::kern {
return this->GetDebugEventInfoImpl(out);
}
void KDebugBase::Finalize() {
/* Perform base finalization. */
KSynchronizationObject::Finalize();
/* Perform post-synchronization finalization. */
this->OnFinalizeSynchronizationObject();
}
void KDebugBase::OnFinalizeSynchronizationObject() {
/* Detach from our process, if we have one. */
if (this->IsAttached() && this->OpenProcess()) {