summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-01-25 15:58:45 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2023-01-25 16:00:10 +0000
commit2c6ef2fec2813e5bec03a9939231b12e7007c193 (patch)
tree35924e607a0c350bbe2308baccbbcc002dc0d8fe
parentbc038c3bd45ee99db9fba23a823a906735740200 (diff)
downloadhaskell-wip/nfdata-name.tar.gz
Force more in NFData Name instancewip/nfdata-name
Doesn't force the lazy `OccName` field (#19619) which is already known as a really bad source of leaks. When we slam the hammer storing Names on disk (in interface files or the like), all this should be forced as otherwise a `Name` can easily retain an `Id` and hence the entire world. Fixes #22833
-rw-r--r--compiler/GHC/Types/Name.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Types/Name.hs b/compiler/GHC/Types/Name.hs
index 7a069a573d..d201cfa5f0 100644
--- a/compiler/GHC/Types/Name.hs
+++ b/compiler/GHC/Types/Name.hs
@@ -155,7 +155,7 @@ instance Outputable NameSort where
ppr System = text "system"
instance NFData Name where
- rnf Name{..} = rnf n_sort
+ rnf Name{..} = rnf n_sort `seq` rnf n_occ `seq` n_uniq `seq` rnf n_loc
instance NFData NameSort where
rnf (External m) = rnf m