diff --git a/rpcs3/Emu/Cell/lv2/sys_config.h b/rpcs3/Emu/Cell/lv2/sys_config.h index 641980850d..ba1ef6c706 100644 --- a/rpcs3/Emu/Cell/lv2/sys_config.h +++ b/rpcs3/Emu/Cell/lv2/sys_config.h @@ -122,7 +122,7 @@ static_assert(sizeof(sys_config_padmanager_data_t) == 26); /* - * Global (fxm-managed) sys_config state + * Global sys_config state */ class lv2_config diff --git a/rpcs3/Emu/IdManager.cpp b/rpcs3/Emu/IdManager.cpp index 19f42c2224..2ac24c2fd7 100644 --- a/rpcs3/Emu/IdManager.cpp +++ b/rpcs3/Emu/IdManager.cpp @@ -6,7 +6,6 @@ shared_mutex id_manager::g_mutex; thread_local DECLARE(idm::g_id); DECLARE(idm::g_map); -DECLARE(fxm::g_vec); id_manager::id_map::pointer idm::allocate_id(const id_manager::id_key& info, u32 base, u32 step, u32 count) { @@ -68,19 +67,3 @@ void idm::clear() map.clear(); } } - -void fxm::init() -{ - // Allocate - g_vec.resize(id_manager::typeinfo::get_count()); - fxm::clear(); -} - -void fxm::clear() -{ - // Call recorded finalization functions for all IDs - for (auto& val : g_vec) - { - val.reset(); - } -} diff --git a/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h index 1dd3059237..f59ad36752 100644 --- a/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -588,132 +588,6 @@ public: } }; -// Object manager for emulated process. One unique object per type, or zero. -class fxm -{ - // Type Index -> Object. Use global since only one process is supported atm. - static std::vector> g_vec; - - template - static inline u32 get_type() - { - return id_manager::typeinfo::get_index(); - } - -public: - // Initialize object manager - static void init(); - - // Remove all objects - static void clear(); - - // Create the object (returns nullptr if it already exists) - template - static std::enable_if_t::value, std::shared_ptr> make(Args&&... args) - { - std::shared_ptr ptr; - { - std::lock_guard lock(id_manager::g_mutex); - - auto& cur = g_vec[get_type()]; - - if (!cur) - { - ptr = std::make_shared(std::forward(args)...); - cur = ptr; - } - else - { - return nullptr; - } - } - - return ptr; - } - - // Emplace the object returned by provider() and return it if no object exists - template - static auto import(F&& provider, Args&&... args) -> decltype(static_cast>(provider(std::forward(args)...))) - { - std::shared_ptr ptr; - { - std::lock_guard lock(id_manager::g_mutex); - - auto& cur = g_vec[get_type()]; - - if (!cur) - { - ptr = provider(std::forward(args)...); - - if (ptr) - { - cur = ptr; - } - } - - if (!ptr) - { - return nullptr; - } - } - - return ptr; - } - - // Unsafe version of check(), can be used in some cases - template - static inline T* check_unlocked() - { - return static_cast(g_vec[get_type()].get()); - } - - // Check whether the object exists - template - static inline T* check() - { - reader_lock lock(id_manager::g_mutex); - - return check_unlocked(); - } - - // Get the object (returns nullptr if it doesn't exist) - template - static inline std::shared_ptr get() - { - reader_lock lock(id_manager::g_mutex); - - auto& ptr = g_vec[get_type()]; - - return {ptr, static_cast(ptr.get())}; - } - - // Delete the object - template - static inline bool remove() - { - std::shared_ptr ptr; - { - std::lock_guard lock(id_manager::g_mutex); - ptr = std::move(g_vec[get_type()]); - } - - return ptr.operator bool(); - } - - // Delete the object and return it - template - static inline std::shared_ptr withdraw() - { - std::shared_ptr ptr; - { - std::lock_guard lock(id_manager::g_mutex); - ptr = std::move(g_vec[get_type()]); - } - - return {ptr, static_cast(ptr.get())}; - } -}; - #include "util/fixed_typemap.hpp" extern stx::manual_fixed_typemap g_fixed_typemap; diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 9fcafa3379..5d6ead1d86 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -322,7 +322,6 @@ void Emulator::Init() } idm::init(); - fxm::init(); g_fxo->reset(); // Reset defaults, cache them @@ -1791,7 +1790,6 @@ void Emulator::Stop(bool restart) lv2_obj::cleanup(); idm::clear(); - fxm::clear(); g_fxo->reset(); LOG_NOTICE(GENERAL, "Objects cleared...");