[project @ 2001-08-02 15:33:35 by ken]
authorken <unknown>
Thu, 2 Aug 2001 15:33:35 +0000 (15:33 +0000)
committerken <unknown>
Thu, 2 Aug 2001 15:33:35 +0000 (15:33 +0000)
Some 64-bit fixes for the new GC code.

ghc/rts/GC.c
ghc/rts/GCCompact.c
ghc/rts/StoragePriv.h

index 74a3e94..9d0b79e 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.111 2001/07/30 12:54:12 simonmar Exp $
+ * $Id: GC.c,v 1.112 2001/08/02 15:33:35 ken Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -40,7 +40,6 @@
 #if defined(RTS_GTK_FRONTPANEL)
 #include "FrontPanel.h"
 #endif
-#include <stddef.h>
 
 /* STATIC OBJECT LIST.
  *
index 9ddd414..d8cef76 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GCCompact.c,v 1.5 2001/07/30 12:57:01 simonmar Exp $
+ * $Id: GCCompact.c,v 1.6 2001/08/02 15:33:35 ken Exp $
  *
  * (c) The GHC Team 2001
  *
@@ -173,7 +173,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
 {
     StgPtr q;
     const StgInfoTable* info;
-    StgWord32 bitmap;
+    StgWord bitmap;
     
     // highly similar to scavenge_stack, but we do pointer threading here.
     
@@ -213,7 +213,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
            p++;
            continue;
            
-           // small bitmap (< 32 entries, or 64 on a 64-bit machine) 
+           // small bitmap (<= 32 entries, or 64 on a 64-bit machine) 
        case UPDATE_FRAME:
        case STOP_FRAME:
        case CATCH_FRAME:
@@ -234,7 +234,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
            }
            continue;
 
-           // large bitmap (> 32 entries) 
+           // large bitmap (> 32 entries, or 64 on a 64-bit machine) 
        case RET_BIG:
        case RET_VEC_BIG:
        {
@@ -247,7 +247,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
 
            for (i=0; i<large_bitmap->size; i++) {
                bitmap = large_bitmap->bitmap[i];
-               q = p + sizeof(W_) * 8;
+               q = p + BITS_IN(W_);
                while (bitmap != 0) {
                    if ((bitmap & 1) == 0) {
                        thread(p);
index f953613..40b606b 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StoragePriv.h,v 1.15 2001/07/23 17:23:20 simonmar Exp $
+ * $Id: StoragePriv.h,v 1.16 2001/08/02 15:33:35 ken Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -10,6 +10,8 @@
 #ifndef STORAGEPRIV_H
 #define STORAGEPRIV_H
 
+#include <stddef.h>
+
 #define END_OF_STATIC_LIST stgCast(StgClosure*,1)
 
 extern generation *generations;
@@ -21,7 +23,7 @@ extern generation *oldest_gen;
 extern void newCAF(StgClosure*);
 
 extern void move_TSO(StgTSO *src, StgTSO *dest);
-extern StgTSO *relocate_stack(StgTSO *dest, int diff);
+extern StgTSO *relocate_stack(StgTSO *dest, ptrdiff_t diff);
 
 extern StgClosure *static_objects;
 extern StgClosure *scavenged_static_objects;