mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-15 11:47:57 -05:00
Common: Refactor & Document Wall clock.
This commit is contained in:
@ -58,7 +58,7 @@ private:
|
||||
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
|
||||
WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
|
||||
std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
|
||||
const auto& caps = GetCPUCaps();
|
||||
u64 rtsc_frequency = 0;
|
||||
if (caps.invariant_tsc) {
|
||||
@ -70,19 +70,16 @@ WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_cloc
|
||||
}
|
||||
}
|
||||
if (rtsc_frequency == 0) {
|
||||
return static_cast<WallClock*>(
|
||||
new StandardWallClock(emulated_cpu_frequency, emulated_clock_frequency));
|
||||
return std::make_unique<StandardWallClock>(emulated_cpu_frequency, emulated_clock_frequency);
|
||||
} else {
|
||||
return static_cast<WallClock*>(
|
||||
new X64::NativeClock(emulated_cpu_frequency, emulated_clock_frequency, rtsc_frequency));
|
||||
return std::make_unique<X64::NativeClock>(emulated_cpu_frequency, emulated_clock_frequency, rtsc_frequency);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
|
||||
return static_cast<WallClock*>(
|
||||
new StandardWallClock(emulated_cpu_frequency, emulated_clock_frequency));
|
||||
std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
|
||||
return std::make_unique<StandardWallClock>(emulated_cpu_frequency, emulated_clock_frequency);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user