From bacd1698fc302460a9a1480258999baf94da1b67 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 27 Feb 2020 21:41:05 +0300 Subject: [PATCH] fixed_typemap.hpp: minor cleanup --- rpcs3/Emu/System.cpp | 8 ++++---- rpcs3/util/fixed_typemap.hpp | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index d56aba588e..c6329e684b 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1763,15 +1763,15 @@ s32 error_code::error_report(const fmt_type_info* sup, u64 arg, const fmt_type_i } template <> -void stx::manual_fixed_typemap::init_reporter(const char* name, unsigned long long created) +void stx::manual_fixed_typemap::init_reporter(const char* name, unsigned long long created) const noexcept { - sys_log.notice("Object '%s' was created [%u]", name, created); + sys_log.notice("[ord:%u] Object '%s' was created", created, name); } template <> -void stx::manual_fixed_typemap::destroy_reporter(const char* name, unsigned long long created) +void stx::manual_fixed_typemap::destroy_reporter(const char* name, unsigned long long created) const noexcept { - sys_log.notice("Object '%s' was destroyed [%u]", name, created); + sys_log.notice("[ord:%u] Object '%s' is destroying", created, name); } Emulator Emu; diff --git a/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp index d39420244b..2e28b4f15d 100644 --- a/rpcs3/util/fixed_typemap.hpp +++ b/rpcs3/util/fixed_typemap.hpp @@ -51,11 +51,21 @@ namespace stx } }; + // Raw pointers to existing objects (may be nullptr) std::unique_ptr m_list; + // Creation order for each object (used to reverse destruction order) std::unique_ptr m_order; + + // Used to generate creation order (increased on every construction) unsigned long long m_init_count = 0; + // Body is somewhere else if enabled + void init_reporter(const char* name, unsigned long long created) const noexcept; + + // Body is somewhere else if enabled + void destroy_reporter(const char* name, unsigned long long created) const noexcept; + public: constexpr manual_fixed_typemap() noexcept = default; @@ -209,11 +219,5 @@ namespace stx { return static_cast(m_list[stx::typeindex>()]); } - - // Body is somewhere else if enabled - void init_reporter(const char* name, unsigned long long created); - - // Body is somewhere else if enabled - void destroy_reporter(const char* name, unsigned long long created); }; }