From c1cf55c7388d01222825911fabca617177966ce9 Mon Sep 17 00:00:00 2001 From: Joel Hestness Date: Wed, 11 Sep 2013 15:33:27 -0500 Subject: 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. --- src/mem/ruby/network/simple/Switch.cc | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mem/ruby/network/simple/Switch.cc') diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc index c28bbdd86..d5c32016e 100644 --- a/src/mem/ruby/network/simple/Switch.cc +++ b/src/mem/ruby/network/simple/Switch.cc @@ -30,7 +30,6 @@ #include "base/cast.hh" #include "base/stl_helpers.hh" -#include "mem/protocol/MessageSizeType.hh" #include "mem/ruby/buffers/MessageBuffer.hh" #include "mem/ruby/network/simple/PerfectSwitch.hh" #include "mem/ruby/network/simple/SimpleNetwork.hh" @@ -44,8 +43,6 @@ using m5::stl_helpers::operator<<; Switch::Switch(const Params *p) : BasicRouter(p) { m_perfect_switch = new PerfectSwitch(m_id, this, p->virt_nets); - m_msg_counts.resize(MessageSizeType_NUM); - m_msg_bytes.resize(MessageSizeType_NUM); } Switch::~Switch() -- cgit v1.2.3