fix gcc warnings for printf formats on 32-bit
[ghc-hetmet.git] / rts / sm / GCUtils.c
index 36fc4f3..4432ad6 100644 (file)
@@ -1,6 +1,6 @@
 /* -----------------------------------------------------------------------------
  *
- * (c) The GHC Team 1998-2006
+ * (c) The GHC Team 1998-2008
  *
  * Generational garbage collector: utilities
  *
@@ -15,6 +15,7 @@
 #include "RtsFlags.h"
 #include "Storage.h"
 #include "GC.h"
+#include "GCThread.h"
 #include "GCUtils.h"
 #include "Printer.h"
 #include "Trace.h"
@@ -34,6 +35,7 @@ allocBlock_sync(void)
 }
 
 
+#if 0
 static void
 allocBlocks_sync(nat n, bdescr **hd, bdescr **tl, 
                  nat gen_no, step *stp,
@@ -55,6 +57,7 @@ allocBlocks_sync(nat n, bdescr **hd, bdescr **tl,
     *tl = &bd[n-1];
     RELEASE_SPIN_LOCK(&gc_alloc_block_sync);
 }
+#endif
 
 void
 freeChain_sync(bdescr *bd)
@@ -175,8 +178,9 @@ todo_block_full (nat size, step_workspace *ws)
         {
             step *stp;
             stp = ws->step;
-            trace(TRACE_gc|DEBUG_gc, "push todo block %p (%d words), step %d, n_todos: %d", 
-                  bd->start, bd->free - bd->u.scan, stp->abs_no, stp->n_todos);
+            trace(TRACE_gc|DEBUG_gc, "push todo block %p (%ld words), step %d, n_todos: %d", 
+                  bd->start, (unsigned long)(bd->free - bd->u.scan),
+                  stp->abs_no, stp->n_todos);
             // ToDo: use buffer_todo
             ACQUIRE_SPIN_LOCK(&stp->sync_todo);
             if (stp->todos_last == NULL) {
@@ -203,8 +207,7 @@ todo_block_full (nat size, step_workspace *ws)
 StgPtr
 alloc_todo_block (step_workspace *ws, nat size)
 {
-    bdescr *bd, *hd, *tl;
-    StgWord32 flags;
+    bdescr *bd/*, *hd, *tl*/;
 
     // Grab a part block if we have one, and it has enough room
     if (ws->part_list != NULL && 
@@ -216,21 +219,22 @@ alloc_todo_block (step_workspace *ws, nat size)
     }
     else
     {
-        // blocks in to-space in generations up to and including N
-        // get the BF_EVACUATED flag.
-        if (ws->step->gen_no <= N) {
-            flags = BF_EVACUATED;
-        } else {
-            flags = 0;
-        }
-        allocBlocks_sync(4, &hd, &tl, 
-                         ws->step->gen_no, ws->step, flags);
-
-        tl->link = ws->part_list;
-        ws->part_list = hd->link;
-        ws->n_part_blocks += 3;
-
-        bd = hd;
+        // blocks in to-space get the BF_EVACUATED flag.
+
+//        allocBlocks_sync(4, &hd, &tl, 
+//                         ws->step->gen_no, ws->step, BF_EVACUATED);
+//
+//        tl->link = ws->part_list;
+//        ws->part_list = hd->link;
+//        ws->n_part_blocks += 3;
+//
+//        bd = hd;
+
+        bd = allocBlock_sync();
+        bd->step = ws->step;
+        bd->gen_no = ws->step->gen_no;
+        bd->flags = BF_EVACUATED;
+        bd->u.scan = bd->free = bd->start;
     }
 
     bd->link = NULL;