diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-06 05:37:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-06 05:37:53 +0200 |
commit | 0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5 (patch) | |
tree | f6631ea4c4cb214db72b6661a20db456e784d054 /src/core | |
parent | Merge pull request #929 from lioncash/addr (diff) | |
parent | core_timing: Convert typedef into a type alias (diff) | |
download | yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar.gz yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar.bz2 yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar.lz yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar.xz yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.tar.zst yuzu-0b80bbeb95cc0015e35a4d43beb97cf98c0cf8c5.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_timing.cpp | 10 | ||||
-rw-r--r-- | src/core/core_timing.h | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index a1b6f96f1..b2e3a495a 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -141,7 +141,7 @@ void ScheduleEvent(s64 cycles_into_future, const EventType* event_type, u64 user ForceExceptionCheck(cycles_into_future); event_queue.emplace_back(Event{timeout, event_fifo_id++, userdata, event_type}); - std::push_heap(event_queue.begin(), event_queue.end(), std::greater<Event>()); + std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>()); } void ScheduleEventThreadsafe(s64 cycles_into_future, const EventType* event_type, u64 userdata) { @@ -156,7 +156,7 @@ void UnscheduleEvent(const EventType* event_type, u64 userdata) { // Removing random items breaks the invariant so we have to re-establish it. if (itr != event_queue.end()) { event_queue.erase(itr, event_queue.end()); - std::make_heap(event_queue.begin(), event_queue.end(), std::greater<Event>()); + std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>()); } } @@ -167,7 +167,7 @@ void RemoveEvent(const EventType* event_type) { // Removing random items breaks the invariant so we have to re-establish it. if (itr != event_queue.end()) { event_queue.erase(itr, event_queue.end()); - std::make_heap(event_queue.begin(), event_queue.end(), std::greater<Event>()); + std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>()); } } @@ -190,7 +190,7 @@ void MoveEvents() { for (Event ev; ts_queue.Pop(ev);) { ev.fifo_order = event_fifo_id++; event_queue.emplace_back(std::move(ev)); - std::push_heap(event_queue.begin(), event_queue.end(), std::greater<Event>()); + std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>()); } } @@ -205,7 +205,7 @@ void Advance() { while (!event_queue.empty() && event_queue.front().time <= global_timer) { Event evt = std::move(event_queue.front()); - std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<Event>()); + std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<>()); event_queue.pop_back(); evt.type->callback(evt.userdata, static_cast<int>(global_timer - evt.time)); } diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 7fe6380ad..5bbde47f4 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -23,6 +23,10 @@ namespace CoreTiming { +struct EventType; + +using TimedCallback = std::function<void(u64 userdata, int cycles_late)>; + /** * CoreTiming begins at the boundary of timing slice -1. An initial call to Advance() is * required to end slice -1 and start slice 0 before the first cycle of code is executed. @@ -30,8 +34,6 @@ namespace CoreTiming { void Init(); void Shutdown(); -typedef std::function<void(u64 userdata, int cycles_late)> TimedCallback; - /** * This should only be called from the emu thread, if you are calling it any other thread, you are * doing something evil @@ -40,8 +42,6 @@ u64 GetTicks(); u64 GetIdleTicks(); void AddTicks(u64 ticks); -struct EventType; - /** * Returns the event_type identifier. if name is not unique, it will assert. */ |