[project @ 1999-05-10 08:23:55 by sof]
[ghc-hetmet.git] / ghc / rts / GC.c
index f44b4fc..9bee6b2 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.55 1999/03/18 17:57:21 simonm Exp $
+ * $Id: GC.c,v 1.58 1999/05/04 10:19:14 sof Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -1134,8 +1134,8 @@ loop:
   /* make sure the info pointer is into text space */
   ASSERT(q && (LOOKS_LIKE_GHC_INFO(GET_INFO(q))
               || IS_HUGS_CONSTR_INFO(GET_INFO(q))));
-
   info = get_itbl(q);
+
   switch (info -> type) {
 
   case BCO:
@@ -1511,7 +1511,7 @@ scavenge_srt(const StgInfoTable *info)
        If the SRT entry hasn't got bit 0 set, the SRT entry points to a
        closure that's fixed at link-time, and no extra magic is required.
     */
-#ifdef HAVE_WIN32_DLL_SUPPORT
+#ifdef ENABLE_WIN32_DLL_SUPPORT
     if ( stgCast(unsigned long,*srt) & 0x1 ) {
        evacuate(*stgCast(StgClosure**,(stgCast(unsigned long, *srt) & ~0x1)));
     } else {
@@ -2313,18 +2313,17 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
    */
 
   while (p < stack_end) {
-    q = *stgCast(StgPtr*,p);
+    q = *(P_ *)p;
 
     /* If we've got a tag, skip over that many words on the stack */
-    if (IS_ARG_TAG(stgCast(StgWord,q))) {
+    if (IS_ARG_TAG((W_)q)) {
       p += ARG_SIZE(q);
       p++; continue;
     }
      
     /* Is q a pointer to a closure?
      */
-
-    if (! LOOKS_LIKE_GHC_INFO(q)) {
+    if (! LOOKS_LIKE_GHC_INFO(q) ) {
 #ifdef DEBUG
       if ( 0 && LOOKS_LIKE_STATIC_CLOSURE(q) ) {  /* Is it a static closure? */
        ASSERT(closure_STATIC(stgCast(StgClosure*,q)));
@@ -2342,14 +2341,14 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
      * record.  All activation records have 'bitmap' style layout
      * info.
      */
-    info  = get_itbl(stgCast(StgClosure*,p));
+    info  = get_itbl((StgClosure *)p);
       
     switch (info->type) {
        
       /* Dynamic bitmap: the mask is stored on the stack */
     case RET_DYN:
-      bitmap = stgCast(StgRetDyn*,p)->liveness;
-      p      = &payloadWord(stgCast(StgRetDyn*,p),0);
+      bitmap = ((StgRetDyn *)p)->liveness;
+      p      = (P_)&((StgRetDyn *)p)->payload[0];
       goto small_bitmap;
 
       /* probably a slow-entry point return address: */