summaryrefslogtreecommitdiff
path: root/rts/RetainerProfile.c
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-07-08 16:29:01 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-17 11:21:10 -0500
commitc4ad915089c440ea35e8727dec9133f4aefcb8c9 (patch)
treeb8d9d52132f4eb713ab28734f2960a4deaf38105 /rts/RetainerProfile.c
parentfd48d8b0aaf65c1c2f12d9e7433091f6984ab182 (diff)
downloadhaskell-c4ad915089c440ea35e8727dec9133f4aefcb8c9.tar.gz
rts: TraverseHeap: Introduce callback for subtree completion
The callback 'return_cb' allows users to be perform additional accounting when the traversal of a subtree is completed. This is needed for example to determine the number or total size of closures reachable from a given closure. This commit also makes the lifetime increase of stackElements from commit "rts: TraverseHeap: Increase lifetime of stackElements" optional based on 'return_cb' being set enabled or not. Note that our definition of "subtree" here includes leaf nodes. So the invariant is that return_cb is called for all nodes in the traversal exactly once.
Diffstat (limited to 'rts/RetainerProfile.c')
-rw-r--r--rts/RetainerProfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index 1e23d8d856..b89519b05d 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -255,9 +255,10 @@ associate( StgClosure *c, RetainerSet *s )
}
static bool
-retainVisitClosure( StgClosure *c, const StgClosure *cp, const stackData data, const bool first_visit, stackData *out_data )
+retainVisitClosure( StgClosure *c, const StgClosure *cp, const stackData data, const bool first_visit, stackAccum *acc, stackData *out_data )
{
(void) first_visit;
+ (void) acc;
retainer r = data.c_child_r;
RetainerSet *s, *retainerSetOfc;