diff -r f5655fbbbb00 -r daf33013a68c src/sim/eventq.hh --- a/src/sim/eventq.hh Sun Apr 18 22:34:59 2010 -0700 +++ b/src/sim/eventq.hh Sun Apr 18 22:35:00 2010 -0700 @@ -372,6 +372,7 @@ std::string objName; Event *head; + bool insert(Event *event, Event *hint); void insert(Event *event); void remove(Event *event); @@ -500,6 +501,20 @@ } }; +inline bool +EventQueue::insert(Event *event, Event *hint) +{ + if (hint->initialized() && hint->scheduled() && *event == *hint) { + assert(event->queue == hint->queue); + event->nextInBin = hint->nextInBin; + hint->nextInBin = event; + return true; + } + + insert(event); + return false; +} + inline void EventQueue::schedule(Event *event, Tick when) {