Skip to content

Memory invariant: No TcLclEnv should be reachable from a Name

I observe leaks due to #19619 where a Name leaves reference to a TcLclEnv. This invariant would be another good one to add to the list of memory invariants in GHC.hs.

│ │    191   0x425a732bb0   _mutVar 0x425a733cd0                                                                                                                                                                 │ │
│ │    192   0x425a731ce0   STRef 0x425a732bb0                                                                                                                                                                   │ │
│ │    193   0x425a730e90   TcLclEnv 0x425dbb7be8 0x425a731c58 0x7fc1c9fa4590 0x7fc1e7f60f20 0x7fc1e7e72ca8 0x425a731c70 0x7fc1e7e72cc8 0x425a731c98 0x425a731cb8 0x425a731ce0 0x425a731cf0 0x425a731d10 0x425a73│ │
│ │  * 194   0x425a7303c8   _thunk( ?? ) 0x425a730e90 0x425a730e78                                                                                                                                               │ │
│ │    195   0x43573706a8   _thunk( ?? ) 0x425a7303c8                                                                                                                                                            │ │
│ │    196   0x435743edf0   Name 0x7fc1e8115d60 0x43573706a8 0x425dbb7488 6989586621679096926                                                                                                                    │ │
│ │    197   0x4288b7ff08   TyVar 0x435743edf0 0x423884e568 6989586621679096926                                                                                                                                  │ │
│ │    198   0x4288b7fed8   Bndr 0x4288b7ff08 0x435743edc8                                                                                                                                                       │ │
│ │    199   0x4288b7ee60   0x4288b7fed8 : 0x4288b7fec0                                                                                                                                                          │ │
│ │    200   0x4288b7e480   AlgTyCon 0x4288b7ee28 0x4288b7ee38 0x4288b7ee60 0x4288b7ee78 0x42daff2478 0x4288b7ee90 0x4288b7eeb8 0x4288b7eed0 0x4288b7eee8 0x4288b7ef08 0x4288b7ef20 0x7fc1c9fa4528 0x4288b7ef38 0│ │
│ │    201   0x425dbb3740   ATyCon 0x4288b7e480                                                                                                                                                                  │ │
│ │    202   0x42ac5dd6b8   Tip 0x425dbb3740 8214565720323784711 
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information