summaryrefslogtreecommitdiffstats
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:
#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