04-04-09-Inflightq

From Msim

Jump to: navigation, search

This refers to the fixes to inflightq.h and rob.h to improve performance.


No longer assume the compiler will elide these functions from inflightq.h, this guarantees the avoidance of extra copies:
Old:

inline typename std::list<T>::iterator erase(typename std::list<T>::iterator it)

New:

inline typename std::list<T>::iterator erase(const typename std::list<T>::iterator & it)

Old:

void inorderinsert(T & toinsert)

New:

void inorderinsert(const T & toinsert)



In rob.h, the comparator functor for the ready_queue now follows proper const behavior: Old:

class seq_sort : public std::binary_function<RS_link,RS_link,bool>
{
 public:
  bool operator()(RS_link & left, RS_link & right)
  {
   return left.x.seq < right.x.seq;
  }
};

New:

class seq_sort : public std::binary_function<RS_link,RS_link,bool>
{
 public:
  bool operator()(const RS_link & left, const RS_link & right)
  {
   return left.x.seq < right.x.seq;
  }
};
Personal tools