diff options
-rw-r--r-- | includes/rts/storage/ClosureMacros.h | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 478ba1a5d7..694320054a 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -117,36 +117,20 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) -------------------------------------------------------------------------- */ #if defined(PROFILING) -#if defined(DEBUG_RETAINER) /* - For the sake of debugging, we take the safest way for the moment. Actually, this - is useful to check the sanity of heap before beginning retainer profiling. - flip is defined in RetainerProfile.c, and declared as extern in RetainerProfile.h. - Note: change those functions building Haskell objects from C datatypes, i.e., - all rts_mk???() functions in RtsAPI.c, as well. - */ -#define SET_PROF_HDR(c,ccs_) \ - ((c)->header.prof.ccs = ccs_, (c)->header.prof.hp.rs = (retainerSet *)((StgWord)NULL | flip)) -#else -/* - For retainer profiling only: we do not have to set (c)->header.prof.hp.rs to - NULL | flip (flip is defined in RetainerProfile.c) because even when flip - is 1, rs is invalid and will be initialized to NULL | flip later when - the closure *c is visited. - */ -/* -#define SET_PROF_HDR(c,ccs_) \ - ((c)->header.prof.ccs = ccs_, (c)->header.prof.hp.rs = NULL) - */ -/* - The following macro works for both retainer profiling and LDV profiling: - for retainer profiling, ldvTime remains 0, so rs fields are initialized to 0. - See the invariants on ldvTime. + The following macro works for both retainer profiling and LDV profiling. For + retainer profiling, 'era' remains 0, so by setting the 'ldvw' field we also set + 'rs' to zero. + + Note that we don't have to bother handling the 'flip' bit properly[1] since the + retainer profiling code will just set 'rs' to NULL upon visiting a closure with + an invalid 'flip' bit anyways. + + [1]: Technically we should set 'rs' to `NULL | flip`. */ #define SET_PROF_HDR(c,ccs_) \ ((c)->header.prof.ccs = ccs_, \ LDV_RECORD_CREATE((c))) -#endif /* DEBUG_RETAINER */ #else #define SET_PROF_HDR(c,ccs) #endif |