Have configure take arguments telling it where gmp is; fixes trac #957
[ghc-hetmet.git] / rts / sm / Compact.c
index f50c994..feebef8 100644 (file)
@@ -1,9 +1,14 @@
 /* -----------------------------------------------------------------------------
  *
- * (c) The GHC Team 2001
+ * (c) The GHC Team 2001-2006
  *
  * Compacting garbage collector
  *
+ * Documentation on the architecture of the Garbage Collector can be
+ * found in the online commentary:
+ * 
+ *   http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
+ *
  * ---------------------------------------------------------------------------*/
 
 #include "PosixSource.h"
@@ -11,8 +16,6 @@
 #include "RtsUtils.h"
 #include "RtsFlags.h"
 #include "OSThreads.h"
-#include "Storage.h"
-#include "Stable.h"
 #include "BlockAlloc.h"
 #include "MBlock.h"
 #include "GC.h"
@@ -263,7 +266,6 @@ thread_stack(StgPtr p, StgPtr stack_end)
        case STOP_FRAME:
        case CATCH_FRAME:
        case RET_SMALL:
-       case RET_VEC_SMALL:
            bitmap = BITMAP_BITS(info->i.layout.bitmap);
            size   = BITMAP_SIZE(info->i.layout.bitmap);
            p++;
@@ -295,7 +297,6 @@ thread_stack(StgPtr p, StgPtr stack_end)
 
            // large bitmap (> 32 entries, or 64 on a 64-bit machine) 
        case RET_BIG:
-       case RET_VEC_BIG:
            p++;
            size = GET_LARGE_BITMAP(&info->i)->size;
            thread_large_bitmap(p, GET_LARGE_BITMAP(&info->i), size);
@@ -398,10 +399,6 @@ thread_TSO (StgTSO *tso)
     if (   tso->why_blocked == BlockedOnMVar
        || tso->why_blocked == BlockedOnBlackHole
        || tso->why_blocked == BlockedOnException
-#if defined(PAR)
-       || tso->why_blocked == BlockedOnGA
-       || tso->why_blocked == BlockedOnGA_NoSend
-#endif
        ) {
        thread_(&tso->block_info.closure);
     }
@@ -531,7 +528,6 @@ thread_obj (StgInfoTable *info, StgPtr p)
        thread_(&bco->instrs);
        thread_(&bco->literals);
        thread_(&bco->ptrs);
-       thread_(&bco->itbls);
        return p + bco_sizeW(bco);
     }
 
@@ -703,10 +699,6 @@ update_fwd( bdescr *blocks )
 
     bd = blocks;
 
-#if defined(PAR)
-    barf("update_fwd: ToDo");
-#endif
-
     // cycle through all the blocks in the step
     for (; bd != NULL; bd = bd->link) {
        p = bd->start;
@@ -735,10 +727,6 @@ update_fwd_compact( bdescr *blocks )
     free_bd = blocks;
     free = free_bd->start;
 
-#if defined(PAR)
-    barf("update_fwd: ToDo");
-#endif
-
     // cycle through all the blocks in the step
     for (; bd != NULL; bd = bd->link) {
        p = bd->start;
@@ -775,6 +763,10 @@ update_fwd_compact( bdescr *blocks )
            // know the destination without the size, because we may
            // spill into the next block.  So we have to run down the 
            // threaded list and get the info ptr first.
+            //
+            // ToDo: one possible avenue of attack is to use the fact
+            // that if (p&BLOCK_MASK) >= (free&BLOCK_MASK), then we
+            // definitely have enough room.  Also see bug #1147.
            info = get_threaded_info(p);
 
            q = p;
@@ -818,10 +810,6 @@ update_bkwd_compact( step *stp )
     free = free_bd->start;
     free_blocks = 1;
 
-#if defined(PAR)
-    barf("update_bkwd: ToDo");
-#endif
-
     // cycle through all the blocks in the step
     for (; bd != NULL; bd = bd->link) {
        p = bd->start;