[project @ 2005-07-26 14:38:42 by simonmar]
[ghc-hetmet.git] / ghc / rts / Stable.c
index eadfa68..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.
 }
 
 /*
@@ -372,13 +376,13 @@ gcStablePtrTable( void )
                if (p->sn_obj == NULL) {
                    // StableName object is dead
                    freeStableName(p);
-                   IF_DEBUG(stable, debugBelch("GC'd Stable name %ld\n", 
+                   IF_DEBUG(stable, debugBelch("GC'd Stable name %d\n", 
                                                p - stable_ptr_table));
                    continue;
                    
                } else {
                  p->addr = (StgPtr)isAlive((StgClosure *)p->addr);
-                   IF_DEBUG(stable, debugBelch("Stable name %ld still alive at %p, ref %ld\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));
                }
            }
        }