diff options
| author | 2018-10-15 09:25:11 -0400 | |
|---|---|---|
| committer | 2018-10-15 14:15:56 -0400 | |
| commit | 5484742fdaf036db03ac7b8c746df5004f74efad (patch) | |
| tree | 71f2f25319773fa718ade73b59fccccfbceedb12 /src/core/core.cpp | |
| parent | core: Make the live Cpu instances unique_ptrs instead of shared_ptrs (diff) | |
| download | yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.gz yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.tar.xz yuzu-5484742fdaf036db03ac7b8c746df5004f74efad.zip | |
core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 52433731a..3c57a62ec 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -355,12 +355,15 @@ std::size_t System::CurrentCoreIndex() { | |||
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | Kernel::Scheduler& System::CurrentScheduler() { | 357 | Kernel::Scheduler& System::CurrentScheduler() { |
| 358 | return *CurrentCpuCore().Scheduler(); | 358 | return CurrentCpuCore().Scheduler(); |
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | const std::shared_ptr<Kernel::Scheduler>& System::Scheduler(std::size_t core_index) { | 361 | Kernel::Scheduler& System::Scheduler(std::size_t core_index) { |
| 362 | ASSERT(core_index < NUM_CPU_CORES); | 362 | return CpuCore(core_index).Scheduler(); |
| 363 | return impl->cpu_cores[core_index]->Scheduler(); | 363 | } |
| 364 | |||
| 365 | const Kernel::Scheduler& System::Scheduler(std::size_t core_index) const { | ||
| 366 | return CpuCore(core_index).Scheduler(); | ||
| 364 | } | 367 | } |
| 365 | 368 | ||
| 366 | Kernel::Process* System::CurrentProcess() { | 369 | Kernel::Process* System::CurrentProcess() { |
| @@ -381,6 +384,11 @@ Cpu& System::CpuCore(std::size_t core_index) { | |||
| 381 | return *impl->cpu_cores[core_index]; | 384 | return *impl->cpu_cores[core_index]; |
| 382 | } | 385 | } |
| 383 | 386 | ||
| 387 | const Cpu& System::CpuCore(std::size_t core_index) const { | ||
| 388 | ASSERT(core_index < NUM_CPU_CORES); | ||
| 389 | return *impl->cpu_cores[core_index]; | ||
| 390 | } | ||
| 391 | |||
| 384 | ExclusiveMonitor& System::Monitor() { | 392 | ExclusiveMonitor& System::Monitor() { |
| 385 | return *impl->cpu_exclusive_monitor; | 393 | return *impl->cpu_exclusive_monitor; |
| 386 | } | 394 | } |