diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-06-20 19:22:45 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2019-09-22 15:17:53 +0200 |
commit | 3ebaa4b5909176e7924f063f58e4de73c7809b0a (patch) | |
tree | 87eba022483f54f3a5126b443936ae9fd0f163bd | |
parent | da12da7945ae59d5132506829612e57db58bbf83 (diff) | |
download | haskell-3ebaa4b5909176e7924f063f58e4de73c7809b0a.tar.gz |
rts: Remove bitrotten retainer debug code
The `defined(DEBUG_RETAINER) == true` branch doesn't even compile anymore
because 1) retainerSet was renamed to RetainerSet and 2) even if I fix that
the context in Rts.h seems to have changed such that it's not in scope. If
3) I fix that 'flip' is still not in scope :) At that point I just gave up.
-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 |