diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-15 19:14:21 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-15 19:41:22 -0400 |
commit | bef1844a51a37c1c8dc531e67069ef00821ffa9c (patch) | |
tree | 2e46f404c3f0baf1b854e1bea916c19469fe424a /src/core/tools/freezer.cpp | |
parent | 8b50c660dfce50a07c2b2aa3c1b6b8642259a944 (diff) |
core_timing: Make TimedCallback take std::chrono::nanoseconds
Enforces our desired time units directly with a concrete type.
Diffstat (limited to 'src/core/tools/freezer.cpp')
-rw-r--r-- | src/core/tools/freezer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp index 5dc52d1c13..27b894b511 100644 --- a/src/core/tools/freezer.cpp +++ b/src/core/tools/freezer.cpp @@ -55,9 +55,10 @@ void MemoryWriteWidth(Core::Memory::Memory& memory, u32 width, VAddr addr, u64 v Freezer::Freezer(Core::Timing::CoreTiming& core_timing_, Core::Memory::Memory& memory_) : core_timing{core_timing_}, memory{memory_} { - event = Core::Timing::CreateEvent( - "MemoryFreezer::FrameCallback", - [this](u64 userdata, s64 ns_late) { FrameCallback(userdata, ns_late); }); + event = Core::Timing::CreateEvent("MemoryFreezer::FrameCallback", + [this](u64 userdata, std::chrono::nanoseconds ns_late) { + FrameCallback(userdata, ns_late); + }); core_timing.ScheduleEvent(memory_freezer_ns, event); } @@ -158,7 +159,7 @@ std::vector<Freezer::Entry> Freezer::GetEntries() const { return entries; } -void Freezer::FrameCallback(u64 userdata, s64 ns_late) { +void Freezer::FrameCallback(u64, std::chrono::nanoseconds ns_late) { if (!IsActive()) { LOG_DEBUG(Common_Memory, "Memory freezer has been deactivated, ending callback events."); return; @@ -173,8 +174,7 @@ void Freezer::FrameCallback(u64 userdata, s64 ns_late) { MemoryWriteWidth(memory, entry.width, entry.address, entry.value); } - const auto future_ns = memory_freezer_ns - std::chrono::nanoseconds{ns_late}; - core_timing.ScheduleEvent(future_ns, event); + core_timing.ScheduleEvent(memory_freezer_ns - ns_late, event); } void Freezer::FillEntryReads() { |