vptr.hh:
[gem5.git] / sim / startup.cc
index ebb4c0bc02bffd14359eba703b12b482a7886b6a..683e6c746cea107e8f492e11e3fdca355f9fd55c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004 The Regents of The University of Michigan
+ * Copyright (c) 2004-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #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();