@@ -26,14 +26,15 @@ instance VisitGCRef HeapObject where
2626 visitGCRef action = \ case
2727 Con {.. } -> visitGCRef action hoConArgs
2828 Closure {.. } -> visitGCRef action hoCloArgs >> visitGCRef action hoEnv
29- BlackHole _ o -> pure ()
29+ BlackHole _o _q -> pure () -- HINT: the blackhole wait queue is handled separately
3030 ApStack {.. } -> visitGCRef action hoResult >> visitGCRef action hoStack
3131 RaiseException ex -> visitGCRef action ex
3232
3333instance VisitGCRef StackContinuation where
3434 visitGCRef action = \ case
3535 CaseOf _ _ env _ _ _ -> visitGCRef action env
36- Update addr -> pure () -- action $ HeapPtr addr -- TODO/FIXME: this is not a GC root!
36+ Update {} -> pure () -- HINT: the thunk is under evaluation, its closure is referred from the thread stack
37+ -- the blackhole wait queue is handled separately
3738 Apply args -> visitGCRef action args
3839 Catch handler _ _ -> visitGCRef action handler
3940 CatchRetry stm alt _ _ -> visitGCRef action stm >> visitGCRef action alt
@@ -153,7 +154,7 @@ visitAtom atom action = case atom of
153154 MutableByteArray i -> action $ encodeRef (baId i) NS_MutableByteArray
154155 WeakPointer i -> action $ encodeRef i NS_WeakPointer
155156 StableName i -> action $ encodeRef i NS_StableName
156- ThreadId i -> pure ( )
157+ ThreadId i -> action $ encodeRef i NS_Thread -- NOTE: in GHC the ThreadId# prim type is a strong pointer to TSO (thread state oject )
157158 LiftedUndefined {} -> pure ()
158159 Rubbish {} -> pure ()
159160 Unbinded {} -> pure ()
0 commit comments