summaryrefslogtreecommitdiffstats
path: root/src/common/wall_clock.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-10 16:20:40 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-18 22:29:18 +0200
commite3524d114246a9221c766bdf1992777b208cbd67 (patch)
tree1454fe38bdafd94ada74ae5f1209a7466bbf4e78 /src/common/wall_clock.cpp
parentCommon: Implement WallClock Interface and implement a native clock for x64 (diff)
downloadyuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.gz
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.bz2
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.lz
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.xz
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.zst
yuzu-e3524d114246a9221c766bdf1992777b208cbd67.zip
Diffstat (limited to 'src/common/wall_clock.cpp')
-rw-r--r--src/common/wall_clock.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp
index eabbba9da..8f5e17fa4 100644
--- a/src/common/wall_clock.cpp
+++ b/src/common/wall_clock.cpp
@@ -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