From c34efbbd60a41afbbab2ff17bbff999519cfb4b6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 15 Oct 2018 08:42:06 -0400 Subject: core: Make CPUBarrier a unique_ptr instead of a shared_ptr This will always outlive the Cpu instances, since it's destroyed after we destroy the Cpu instances on shutdown, so there's no need for shared ownership semantics here. --- src/core/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/core.cpp') diff --git a/src/core/core.cpp b/src/core/core.cpp index 32baa40dc..1b9b1f608 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -139,10 +139,10 @@ struct System::Impl { auto main_process = Kernel::Process::Create(kernel, "main"); kernel.MakeCurrentProcess(main_process.get()); - cpu_barrier = std::make_shared(); + cpu_barrier = std::make_unique(); cpu_exclusive_monitor = Cpu::MakeExclusiveMonitor(cpu_cores.size()); for (std::size_t index = 0; index < cpu_cores.size(); ++index) { - cpu_cores[index] = std::make_shared(cpu_exclusive_monitor, cpu_barrier, index); + cpu_cores[index] = std::make_shared(cpu_exclusive_monitor, *cpu_barrier, index); } telemetry_session = std::make_unique(); @@ -283,7 +283,7 @@ struct System::Impl { std::unique_ptr gpu_core; std::shared_ptr debug_context; std::shared_ptr cpu_exclusive_monitor; - std::shared_ptr cpu_barrier; + std::unique_ptr cpu_barrier; std::array, NUM_CPU_CORES> cpu_cores; std::array, NUM_CPU_CORES - 1> cpu_core_threads; std::size_t active_core{}; ///< Active core, only used in single thread mode -- cgit v1.2.3