From cda15f08d8d96d43436d8d5609ad7dc72a598863 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 3 Aug 2020 08:03:26 -0700 Subject: [PATCH] kern: mark KThread/KProcess.GetId() final to save virtual calls --- libraries/libmesosphere/include/mesosphere/kern_k_process.hpp | 2 +- libraries/libmesosphere/include/mesosphere/kern_k_thread.hpp | 2 +- libraries/libmesosphere/include/mesosphere/kern_k_trace.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_process.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_process.hpp index 5378b8012..4e74fe728 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_process.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_process.hpp @@ -377,7 +377,7 @@ namespace ams::kern { virtual void Finalize() override; - virtual u64 GetId() const override { return this->GetProcessId(); } + virtual u64 GetId() const override final { return this->GetProcessId(); } virtual bool IsSignaled() const override { MESOSPHERE_ASSERT_THIS(); diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_thread.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_thread.hpp index 5ffb5b434..bd959c2e7 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_thread.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_thread.hpp @@ -523,7 +523,7 @@ namespace ams::kern { public: /* Overridden parent functions. */ - virtual u64 GetId() const override { return this->GetThreadId(); } + virtual u64 GetId() const override final { return this->GetThreadId(); } virtual bool IsInitialized() const override { return this->initialized; } virtual uintptr_t GetPostDestroyArgument() const override { return reinterpret_cast(this->parent) | (this->resource_limit_release_hint ? 1 : 0); } diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_trace.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_trace.hpp index 6fe20ac99..b1d9e3221 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_trace.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_trace.hpp @@ -83,4 +83,4 @@ namespace ams::kern { ::ams::kern::KTrace::PushRecord(::ams::kern::KTrace::Type_SvcExit1, PARAM5, PARAM6, PARAM7); \ } \ } \ - }) \ No newline at end of file + })