diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-28 13:34:02 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-07-12 20:07:05 +0000 |
commit | fc575f8266149c78b29bcbe12ab86ccb7614ffbf (patch) | |
tree | 8f6ad3a6af8a5b4c529638b94ceb7a897d6192fb /src/mem/ruby/common | |
parent | 381aa8498997f5ce93480511f7514be85356687a (diff) | |
download | gem5-fc575f8266149c78b29bcbe12ab86ccb7614ffbf.tar.xz |
ruby: Refactor some Event subclasses to lambdas
Change-Id: I9f47a20a869553515a759d9a29c05f6ce4b42d64
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3930
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r-- | src/mem/ruby/common/Consumer.cc | 4 | ||||
-rw-r--r-- | src/mem/ruby/common/Consumer.hh | 14 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/mem/ruby/common/Consumer.cc b/src/mem/ruby/common/Consumer.cc index 59605d51b..f68ee14d0 100644 --- a/src/mem/ruby/common/Consumer.cc +++ b/src/mem/ruby/common/Consumer.cc @@ -41,7 +41,9 @@ Consumer::scheduleEventAbsolute(Tick evt_time) { if (!alreadyScheduled(evt_time)) { // This wakeup is not redundant - ConsumerEvent *evt = new ConsumerEvent(this); + auto *evt = new EventFunctionWrapper( + [this]{ wakeup(); }, "Consumer Event", true); + em->schedule(evt, evt_time); insertScheduledWakeupTime(evt_time); } diff --git a/src/mem/ruby/common/Consumer.hh b/src/mem/ruby/common/Consumer.hh index 20f2bdd0f..b0d35bf70 100644 --- a/src/mem/ruby/common/Consumer.hh +++ b/src/mem/ruby/common/Consumer.hh @@ -76,20 +76,6 @@ class Consumer private: std::set<Tick> m_scheduled_wakeups; ClockedObject *em; - - class ConsumerEvent : public Event - { - public: - ConsumerEvent(Consumer* _consumer) - : Event(Default_Pri, AutoDelete), m_consumer_ptr(_consumer) - { - } - - void process() { m_consumer_ptr->wakeup(); } - - private: - Consumer* m_consumer_ptr; - }; }; inline std::ostream& |