diff options
| author | 2018-10-15 08:53:01 -0400 | |
|---|---|---|
| committer | 2018-10-15 14:15:50 -0400 | |
| commit | aeadbfa790b11ba859605df8a9357b960084b2a0 (patch) | |
| tree | eb46f94603e38f81ccf443024357ad567d5ef15b /src/core/core_cpu.cpp | |
| parent | core: Make CPUBarrier a unique_ptr instead of a shared_ptr (diff) | |
| download | yuzu-aeadbfa790b11ba859605df8a9357b960084b2a0.tar.gz yuzu-aeadbfa790b11ba859605df8a9357b960084b2a0.tar.xz yuzu-aeadbfa790b11ba859605df8a9357b960084b2a0.zip | |
core: Make the exclusive monitor a unique_ptr instead of a shared_ptr
Like the barrier, this is owned entirely by the System and will always
outlive the encompassing state, so shared ownership semantics aren't
necessary here.
Diffstat (limited to 'src/core/core_cpu.cpp')
| -rw-r--r-- | src/core/core_cpu.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp index 928262c9b..9f856ca6e 100644 --- a/src/core/core_cpu.cpp +++ b/src/core/core_cpu.cpp | |||
| @@ -49,8 +49,7 @@ bool CpuBarrier::Rendezvous() { | |||
| 49 | return false; | 49 | return false; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | Cpu::Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, CpuBarrier& cpu_barrier, | 52 | Cpu::Cpu(ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier, std::size_t core_index) |
| 53 | std::size_t core_index) | ||
| 54 | : cpu_barrier{cpu_barrier}, core_index{core_index} { | 53 | : cpu_barrier{cpu_barrier}, core_index{core_index} { |
| 55 | if (Settings::values.use_cpu_jit) { | 54 | if (Settings::values.use_cpu_jit) { |
| 56 | #ifdef ARCHITECTURE_x86_64 | 55 | #ifdef ARCHITECTURE_x86_64 |
| @@ -68,10 +67,10 @@ Cpu::Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, CpuBarrier& cpu_ba | |||
| 68 | 67 | ||
| 69 | Cpu::~Cpu() = default; | 68 | Cpu::~Cpu() = default; |
| 70 | 69 | ||
| 71 | std::shared_ptr<ExclusiveMonitor> Cpu::MakeExclusiveMonitor(std::size_t num_cores) { | 70 | std::unique_ptr<ExclusiveMonitor> Cpu::MakeExclusiveMonitor(std::size_t num_cores) { |
| 72 | if (Settings::values.use_cpu_jit) { | 71 | if (Settings::values.use_cpu_jit) { |
| 73 | #ifdef ARCHITECTURE_x86_64 | 72 | #ifdef ARCHITECTURE_x86_64 |
| 74 | return std::make_shared<DynarmicExclusiveMonitor>(num_cores); | 73 | return std::make_unique<DynarmicExclusiveMonitor>(num_cores); |
| 75 | #else | 74 | #else |
| 76 | return nullptr; // TODO(merry): Passthrough exclusive monitor | 75 | return nullptr; // TODO(merry): Passthrough exclusive monitor |
| 77 | #endif | 76 | #endif |