Skip to content
Snippets Groups Projects
Commit c7f531f4 authored by Matthew Pickering's avatar Matthew Pickering
Browse files

Refine retainer calculation

parent f6c1d25d
No related branches found
No related tags found
No related merge requests found
...@@ -53,12 +53,14 @@ findRetainers limit rroots p = (\(_, r, _) -> snd r) <$> runRWST (traceFromM fun ...@@ -53,12 +53,14 @@ findRetainers limit rroots p = (\(_, r, _) -> snd r) <$> runRWST (traceFromM fun
-> SizedClosure -> SizedClosure
-> RWST [ClosurePtr] () (Maybe Int, [[ClosurePtr]]) DebugM () -> RWST [ClosurePtr] () (Maybe Int, [[ClosurePtr]]) DebugM ()
-> RWST [ClosurePtr] () (Maybe Int, [[ClosurePtr]]) DebugM () -> RWST [ClosurePtr] () (Maybe Int, [[ClosurePtr]]) DebugM ()
closAccum _ (noSize -> WeakClosure {}) _ = return ()
closAccum cp sc k = do closAccum cp sc k = do
b <- lift $ p cp sc b <- lift $ p cp sc
if b if b
then do then do
ctx <- ask ctx <- ask
modify' (addOne (cp: ctx)) modify' (addOne (cp: ctx))
local (cp:) k
-- Don't call k, there might be more paths to the pointer but we -- Don't call k, there might be more paths to the pointer but we
-- probably just care about this first one. -- probably just care about this first one.
else do else do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment