remove unused includes, now that Storage.h & Stable.h are included by Rts.h
[ghc-hetmet.git] / rts / RetainerProfile.c
index a18a194..23d6f9d 100644 (file)
 #include "RetainerSet.h"
 #include "Schedule.h"
 #include "Printer.h"
-#include "Storage.h"
 #include "RtsFlags.h"
 #include "Weak.h"
 #include "Sanity.h"
 #include "Profiling.h"
 #include "Stats.h"
-#include "BlockAlloc.h"
 #include "ProfHeap.h"
 #include "Apply.h"
 
@@ -591,8 +589,8 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
            return;     // no child
        break;
        
-    case TVAR_WAIT_QUEUE:
-       *first_child = (StgClosure *)((StgTVarWaitQueue *)c)->waiting_tso;
+    case TVAR_WATCH_QUEUE:
+       *first_child = (StgClosure *)((StgTVarWatchQueue *)c)->closure;
        se.info.next.step = 2;            // 2 = second
        break;
     case TVAR:
@@ -662,6 +660,12 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
     // following statement by either a memcpy() call or a switch statement
     // on the type of the element. Currently, the size of stackElement is
     // small enough (5 words) that this direct assignment seems to be enough.
+
+    // ToDo: The line below leads to the warning:
+    //    warning: 'se.info.type' may be used uninitialized in this function
+    // This is caused by the fact that there are execution paths through the
+    // large switch statement above where some cases do not initialize this
+    // field. Is this really harmless? Can we avoid the warning?
     *stackTop = se;
 
 #ifdef DEBUG_RETAINER
@@ -830,13 +834,13 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
            *r = se->c_child_r;
            return;
 
-       case TVAR_WAIT_QUEUE:
+       case TVAR_WATCH_QUEUE:
            if (se->info.next.step == 2) {
-               *c = (StgClosure *)((StgTVarWaitQueue *)se->c)->next_queue_entry;
+               *c = (StgClosure *)((StgTVarWatchQueue *)se->c)->next_queue_entry;
                se->info.next.step++;             // move to the next step
                // no popOff
            } else {
-               *c = (StgClosure *)((StgTVarWaitQueue *)se->c)->prev_queue_entry;
+               *c = (StgClosure *)((StgTVarWatchQueue *)se->c)->prev_queue_entry;
                popOff();
            }
            *cp = se->c;
@@ -844,7 +848,7 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
            return;
 
        case TVAR:
-           *c = (StgClosure *)((StgTVar *)se->c)->first_wait_queue_entry;
+           *c = (StgClosure *)((StgTVar *)se->c)->first_watch_queue_entry;
            *cp = se->c;
            *r = se->c_child_r;
            popOff();
@@ -1125,7 +1129,7 @@ isRetainer( StgClosure *c )
     case BCO:
     case ARR_WORDS:
        // STM
-    case TVAR_WAIT_QUEUE:
+    case TVAR_WATCH_QUEUE:
     case TREC_HEADER:
     case TREC_CHUNK:
        return rtsFalse;