diff options
author | Nathan Binkert <nate@binkert.org> | 2010-06-10 23:17:07 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-06-10 23:17:07 -0700 |
commit | 006818aeea6176c4500c5f7414e9f2a822c77062 (patch) | |
tree | 74adbd6cc14951943bd6eafc4aba2fb98be7a526 /src/mem/gems_common/PrioHeap.hh | |
parent | bc87fa30d72df7db6265be50b2c39dc218076f9f (diff) | |
download | gem5-006818aeea6176c4500c5f7414e9f2a822c77062.tar.xz |
ruby: get rid of Vector and use STL
add a couple of helper functions to base for deleteing all pointers in
a container and outputting containers to a stream
Diffstat (limited to 'src/mem/gems_common/PrioHeap.hh')
-rw-r--r-- | src/mem/gems_common/PrioHeap.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mem/gems_common/PrioHeap.hh b/src/mem/gems_common/PrioHeap.hh index d6183cf40..266d35e6a 100644 --- a/src/mem/gems_common/PrioHeap.hh +++ b/src/mem/gems_common/PrioHeap.hh @@ -29,9 +29,9 @@ #ifndef PRIOHEAP_H #define PRIOHEAP_H +#include <cassert> #include <iostream> - -#include "mem/gems_common/Vector.hh" +#include <vector> typedef unsigned int HeapIndex; @@ -63,7 +63,7 @@ private: PrioHeap<TYPE>& operator=(const PrioHeap& obj); // Data Members (m_ prefix) - Vector<TYPE> m_heap; + std::vector<TYPE> m_heap; HeapIndex m_current_size; }; @@ -109,7 +109,7 @@ void PrioHeap<TYPE>::insert(const TYPE& key) int i; // grow the vector size m_current_size++; - m_heap.setSize(m_current_size+1); + m_heap.resize(m_current_size+1); if(m_current_size == 1){ // HACK: need to initialize index 0 to avoid purify UMCs m_heap[0] = key; @@ -214,7 +214,7 @@ void PrioHeap<TYPE>::heapify() template <class TYPE> void PrioHeap<TYPE>::print(std::ostream& out) const { - Vector<TYPE> copyHeap(m_heap); + std::vector<TYPE> copyHeap(m_heap); // sort copyHeap (inefficient, but will not be done often) |