summaryrefslogtreecommitdiff
path: root/src/cpu/o3/dep_graph.hh
diff options
context:
space:
mode:
authorRekai Gonzalez-Alberquilla <rekai.gonzalezalberquilla@arm.com>2017-03-01 13:49:08 +0000
committerGiacomo Gabrielli <giacomo.gabrielli@arm.com>2018-12-03 14:23:56 +0000
commit9af1214ffe48178c0dadfb874fd62bd0ff2e0f31 (patch)
tree1b4dd7edf77791c81f40f6d919829495eb80db93 /src/cpu/o3/dep_graph.hh
parentb5cc34d767410e98f54f2955bb274f0f8c3708e4 (diff)
downloadgem5-9af1214ffe48178c0dadfb874fd62bd0ff2e0f31.tar.xz
cpu: Change raw pointers to STL Containers
This patch changes two members from being raw pointers to being STL containers. The reason behind, other than cleanlyness and arguable OO best practices is that containers have more intronspections capabilities than naked pointers do, as the size is known. Using STL containers adds little overhead and eases the automation of process during debugging (gdb). Change-Id: I4d9d3eedafa8b5e50ac512ea93b458a4200229f2 Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/13126 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu/o3/dep_graph.hh')
-rw-r--r--src/cpu/o3/dep_graph.hh5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cpu/o3/dep_graph.hh b/src/cpu/o3/dep_graph.hh
index 212130e2b..2e866a6c5 100644
--- a/src/cpu/o3/dep_graph.hh
+++ b/src/cpu/o3/dep_graph.hh
@@ -122,7 +122,7 @@ class DependencyGraph
* instructions in flight that are dependent upon r34 will be
* in the linked list of dependGraph[34].
*/
- DepEntry *dependGraph;
+ std::vector<DepEntry> dependGraph;
/** Number of linked lists; identical to the number of registers. */
int numEntries;
@@ -140,7 +140,6 @@ class DependencyGraph
template <class DynInstPtr>
DependencyGraph<DynInstPtr>::~DependencyGraph()
{
- delete [] dependGraph;
}
template <class DynInstPtr>
@@ -148,7 +147,7 @@ void
DependencyGraph<DynInstPtr>::resize(int num_entries)
{
numEntries = num_entries;
- dependGraph = new DepEntry[numEntries];
+ dependGraph.resize(numEntries);
}
template <class DynInstPtr>