[project @ 2005-05-27 14:47:08 by tharris]
[ghc-hetmet.git] / ghc / rts / Stable.c
index a2b1136..93b2246 100644 (file)
@@ -13,6 +13,7 @@
 #include "Rts.h"
 #include "Hash.h"
 #include "RtsUtils.h"
+#include "OSThreads.h"
 #include "Storage.h"
 #include "RtsAPI.h"
 #include "RtsFlags.h"
@@ -136,6 +137,9 @@ initStablePtrTable(void)
     // Nothing to do:
     // the table will be allocated the first time makeStablePtr is
     // called, and we want the table to persist through multiple inits.
+    //
+    // Also, getStablePtr is now called from __attribute__((constructor))
+    // functions, so initialising things here wouldn't work anyway.
 }
 
 /*
@@ -179,7 +183,7 @@ lookupStableName(StgPtr p)
   
   if (sn != 0) {
     ASSERT(stable_ptr_table[sn].addr == p);
-    IF_DEBUG(stable,debugBelch("cached stable name %d at %p\n",sn,p));
+    IF_DEBUG(stable,debugBelch("cached stable name %ld at %p\n",sn,p));
     return sn;
   } else {
     sn = stable_ptr_free - stable_ptr_table;
@@ -378,7 +382,7 @@ gcStablePtrTable( void )
                    
                } else {
                  p->addr = (StgPtr)isAlive((StgClosure *)p->addr);
-                   IF_DEBUG(stable, debugBelch("Stable name %d still alive at %p, ref %d\n", p - stable_ptr_table, p->addr, p->ref));
+                   IF_DEBUG(stable, debugBelch("Stable name %d still alive at %p, ref %ld\n", p - stable_ptr_table, p->addr, p->ref));
                }
            }
        }