VERY experimental Nintendo Switch 2 emulator
C++
kernel/physical_core: Make use of std::unique_ptr
Lioncash371f3ecf5de9
diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cppindex e96d063fdc..9303dd273c 100644--- a/src/core/hle/kernel/physical_core.cpp+++ b/src/core/hle/kernel/physical_core.cpp@@ -20,13 +20,13 @@ PhysicalCore::PhysicalCore(Core::System& system, std::size_t id,Core::ExclusiveMonitor& exclusive_monitor): core_index{id} {#ifdef ARCHITECTURE_x86_64- arm_interface = std::make_shared<Core::ARM_Dynarmic>(system, exclusive_monitor, core_index);+ arm_interface = std::make_unique<Core::ARM_Dynarmic>(system, exclusive_monitor, core_index);#elsearm_interface = std::make_shared<Core::ARM_Unicorn>(system);LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");#endif- scheduler = std::make_shared<Kernel::Scheduler>(system, *arm_interface, core_index);+ scheduler = std::make_unique<Kernel::Scheduler>(system, *arm_interface, core_index);}PhysicalCore::~PhysicalCore() = default;diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.hindex 7dca97d1b9..4c32c0f1b9 100644--- a/src/core/hle/kernel/physical_core.h+++ b/src/core/hle/kernel/physical_core.h@@ -24,6 +24,12 @@ public:PhysicalCore(Core::System& system, std::size_t id, Core::ExclusiveMonitor& exclusive_monitor);~PhysicalCore();+ PhysicalCore(const PhysicalCore&) = delete;+ PhysicalCore& operator=(const PhysicalCore&) = delete;++ PhysicalCore(PhysicalCore&&) = default;+ PhysicalCore& operator=(PhysicalCore&&) = default;+/// Execute current jit statevoid Run();/// Execute a single instruction in current jit.@@ -64,8 +70,8 @@ public:private:std::size_t core_index;- std::shared_ptr<Core::ARM_Interface> arm_interface;- std::shared_ptr<Kernel::Scheduler> scheduler;+ std::unique_ptr<Core::ARM_Interface> arm_interface;+ std::unique_ptr<Kernel::Scheduler> scheduler;};} // namespace Kernel