kern: remove need for explicit reserved member in KAutoObject

This commit is contained in:
Michael Scire 2021-10-16 17:17:26 -07:00
parent bfffe6b119
commit 96d3187f3e

View file

@ -77,17 +77,13 @@ namespace ams::kern {
std::atomic<u32> m_ref_count; std::atomic<u32> m_ref_count;
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
ClassTokenType m_class_token; ClassTokenType m_class_token;
#else
u32 m_reserved;
#endif #endif
public: public:
static KAutoObject *Create(KAutoObject *ptr); static KAutoObject *Create(KAutoObject *ptr);
public: 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) #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
m_class_token(0) , m_class_token(0)
#else
m_reserved(0)
#endif #endif
{ {
MESOSPHERE_ASSERT_THIS(); MESOSPHERE_ASSERT_THIS();
@ -159,7 +155,14 @@ namespace ams::kern {
class KAutoObjectWithListContainer; 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: private:
friend class KAutoObjectWithListContainer; friend class KAutoObjectWithListContainer;
private: private: