From 937feda39e0cc79cd5d23d36f5a81155d992b9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 16 Jul 2019 15:03:13 +0200 Subject: rts: TraverseHeap: Make "flip" bit flip into it's own function --- rts/TraverseHeap.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'rts/TraverseHeap.h') diff --git a/rts/TraverseHeap.h b/rts/TraverseHeap.h index b0ecbd2a02..e24b0aae87 100644 --- a/rts/TraverseHeap.h +++ b/rts/TraverseHeap.h @@ -56,9 +56,11 @@ typedef struct traverseState_ { * variable, 'flip' and "flip" this variable when we want to invalidate all * objects. * - * When the visited bit is equal to the value of 'flip' the closure data - * is valid otherwise not (see isTravDataValid). We then invert the value of - * 'flip' after each each profiling run (see traverseWorkStack). + * When the visited bit is equal to the value of 'flip' the closure data is + * valid otherwise not (see isTravDataValid). Both the value of the closure + * and global 'flip' value start out as zero, so all closures are considered + * valid. Before every traversal we invert the value of 'flip' (see + * traverseInvalidateClosureData) invalidating all closures. * * There are some complications with this approach, namely: static objects * and mutable data. There we do just go over all existing objects to reset @@ -162,6 +164,7 @@ bool isTravDataValid(const traverseState *ts, const StgClosure *c); void traverseWorkStack(traverseState *ts, visitClosure_cb visit_cb); void traversePushRoot(traverseState *ts, StgClosure *c, StgClosure *cp, stackData data); bool traverseMaybeInitClosureData(const traverseState* ts, StgClosure *c); +void traverseInvalidateClosureData(traverseState* ts); void initializeTraverseStack(traverseState *ts); void closeTraverseStack(traverseState *ts); -- cgit v1.2.1