From 96d3187f3e7c98a1116161424ee9e4c55197a10f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 16 Oct 2021 17:17:26 -0700 Subject: [PATCH] kern: remove need for explicit reserved member in KAutoObject --- .../include/mesosphere/kern_k_auto_object.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp index d4c0ca600..f1dca1b7f 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp @@ -77,17 +77,13 @@ namespace ams::kern { std::atomic m_ref_count; #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) ClassTokenType m_class_token; - #else - u32 m_reserved; #endif public: static KAutoObject *Create(KAutoObject *ptr); public: - constexpr ALWAYS_INLINE explicit KAutoObject() : m_next_closed_object(nullptr), m_ref_count(0), + constexpr ALWAYS_INLINE explicit KAutoObject() : m_next_closed_object(nullptr), m_ref_count(0) #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) - m_class_token(0) - #else - m_reserved(0) + , m_class_token(0) #endif { MESOSPHERE_ASSERT_THIS(); @@ -159,7 +155,14 @@ namespace ams::kern { class KAutoObjectWithListContainer; - class KAutoObjectWithList : public KAutoObject { + class KAutoObjectWithListBase : public KAutoObject { + private: + void *m_alignment_forcer_unused[0]{}; + public: + constexpr ALWAYS_INLINE KAutoObjectWithListBase() = default; + }; + + class KAutoObjectWithList : public KAutoObjectWithListBase { private: friend class KAutoObjectWithListContainer; private: