diff options
author | Kevin Lim <ktlim@umich.edu> | 2005-01-18 13:02:47 -0500 |
---|---|---|
committer | Kevin Lim <ktlim@umich.edu> | 2005-01-18 13:02:47 -0500 |
commit | aed3e6780a54f2d4f008a8cf7f66e2bbdc788a0d (patch) | |
tree | f48c9d361d04cc6276ef33a9898eb0ac61de36d7 /sim/startup.cc | |
parent | 783f701247a1013a32d7caab324660c211215a11 (diff) | |
parent | f31a27a030d2e93fef2934aa8642609bb38974af (diff) | |
download | gem5-aed3e6780a54f2d4f008a8cf7f66e2bbdc788a0d.tar.xz |
Merge changes to make m5 g++ 3.4 compatible.
sim/param.cc:
Merge changes.
--HG--
extra : convert_revision : b5044e1f7c48ae2d74d5233dd4fabfb7a801d7c8
Diffstat (limited to 'sim/startup.cc')
-rw-r--r-- | sim/startup.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sim/startup.cc b/sim/startup.cc index ebb4c0bc0..7cc0ac8fb 100644 --- a/sim/startup.cc +++ b/sim/startup.cc @@ -29,20 +29,32 @@ #include <list> #include "base/misc.hh" -#include "sim/startup.hh" #include "sim/debug.hh" +#include "sim/startup.hh" typedef std::list<StartupCallback *> startupq_t; -startupq_t &startupq() { static startupq_t queue; return queue; } -StartupCallback::StartupCallback() { startupq().push_back(this); } -StartupCallback::~StartupCallback() { startupq().remove(this); } + +startupq_t *startupq = NULL; + +StartupCallback::StartupCallback() +{ + if (startupq == NULL) + startupq = new startupq_t; + startupq->push_back(this); +} + +StartupCallback::~StartupCallback() +{ + startupq->remove(this); +} + void StartupCallback::startup() { } void SimStartup() { - startupq_t::iterator i = startupq().begin(); - startupq_t::iterator end = startupq().end(); + startupq_t::iterator i = startupq->begin(); + startupq_t::iterator end = startupq->end(); while (i != end) { (*i)->startup(); |