diff options
| author | Fernando S <fsahmkow27@gmail.com> | 2023-09-29 13:37:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-29 13:37:19 +0200 |
| commit | 184ee2d890baa82be7d92af4f9c864e6893f3490 (patch) | |
| tree | 34214bc52594a38879cdd29d3ed313c678a37f7f /src/core/core_timing.h | |
| parent | d6b3e7f195dcf9a154f4e1ff84c6a1b46ad5bdfc (diff) | |
| parent | f70bafff1a97eb363a81666d187593584b9b7fe7 (diff) | |
Merge pull request #11493 from merryhime/evt
core_timing: Replace queue with a fibonacci heap
Diffstat (limited to 'src/core/core_timing.h')
| -rw-r--r-- | src/core/core_timing.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index c20e906fb..26a8b93a7 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -11,7 +11,8 @@ #include <optional> #include <string> #include <thread> -#include <vector> + +#include <boost/heap/fibonacci_heap.hpp> #include "common/common_types.h" #include "common/thread.h" @@ -151,11 +152,10 @@ private: s64 timer_resolution_ns; #endif - // The queue is a min-heap using std::make_heap/push_heap/pop_heap. - // We don't use std::priority_queue because we need to be able to serialize, unserialize and - // erase arbitrary events (RemoveEvent()) regardless of the queue order. These aren't - // accommodated by the standard adaptor class. - std::vector<Event> event_queue; + using heap_t = + boost::heap::fibonacci_heap<CoreTiming::Event, boost::heap::compare<std::greater<>>>; + + heap_t event_queue; u64 event_fifo_id = 0; std::shared_ptr<EventType> ev_lost; |
