summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple/SimpleNetwork.hh
diff options
context:
space:
mode:
authorJoel Hestness <jthestness@gmail.com>2013-09-11 15:33:27 -0500
committerJoel Hestness <jthestness@gmail.com>2013-09-11 15:33:27 -0500
commitc1cf55c7388d01222825911fabca617177966ce9 (patch)
treef71b0f44ae3452515d7434d0c45f3d2f1a74ed49 /src/mem/ruby/network/simple/SimpleNetwork.hh
parente391fd151b589648901b86be71971713e8ee4c59 (diff)
downloadgem5-c1cf55c7388d01222825911fabca617177966ce9.tar.xz
ruby: Statically allocate stats in SimpleNetwork, Switch, Throttle
The previous changeset (9863:9483739f83ee) used STL vector containers to dynamically allocate stats in the Ruby SimpleNetwork, Switch and Throttle. For gcc versions before at least 4.6.3, this causes the standard vector allocator to call Stats copy constructors (a no-no, since stats should be allocated in the body of each SimObject instance). Since the size of these stats arrays is known at compile time (NOTE: after code generation), this patch changes their allocation to be static rather than using an STL vector.
Diffstat (limited to 'src/mem/ruby/network/simple/SimpleNetwork.hh')
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh
index 06db20c0b..69aeeffb7 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.hh
+++ b/src/mem/ruby/network/simple/SimpleNetwork.hh
@@ -111,8 +111,8 @@ class SimpleNetwork : public Network
bool m_adaptive_routing;
//Statistical variables
- std::vector<Stats::Formula> m_msg_counts;
- std::vector<Stats::Formula> m_msg_bytes;
+ Stats::Formula m_msg_counts[MessageSizeType_NUM];
+ Stats::Formula m_msg_bytes[MessageSizeType_NUM];
};
inline std::ostream&