summaryrefslogtreecommitdiff
path: root/src/common/wall_clock.cpp
diff options
context:
space:
mode:
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:
58 58
59#ifdef ARCHITECTURE_x86_64 59#ifdef ARCHITECTURE_x86_64
60 60
61WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) { 61std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
62 const auto& caps = GetCPUCaps(); 62 const auto& caps = GetCPUCaps();
63 u64 rtsc_frequency = 0; 63 u64 rtsc_frequency = 0;
64 if (caps.invariant_tsc) { 64 if (caps.invariant_tsc) {
@@ -70,19 +70,16 @@ WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_cloc
70 } 70 }
71 } 71 }
72 if (rtsc_frequency == 0) { 72 if (rtsc_frequency == 0) {
73 return static_cast<WallClock*>( 73 return std::make_unique<StandardWallClock>(emulated_cpu_frequency, emulated_clock_frequency);
74 new StandardWallClock(emulated_cpu_frequency, emulated_clock_frequency));
75 } else { 74 } else {
76 return static_cast<WallClock*>( 75 return std::make_unique<X64::NativeClock>(emulated_cpu_frequency, emulated_clock_frequency, rtsc_frequency);
77 new X64::NativeClock(emulated_cpu_frequency, emulated_clock_frequency, rtsc_frequency));
78 } 76 }
79} 77}
80 78
81#else 79#else
82 80
83WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) { 81std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency) {
84 return static_cast<WallClock*>( 82 return std::make_unique<StandardWallClock>(emulated_cpu_frequency, emulated_clock_frequency);
85 new StandardWallClock(emulated_cpu_frequency, emulated_clock_frequency));
86} 83}
87 84
88#endif 85#endif