summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-01-25 15:58:45 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-26 12:34:56 -0500
commite27eb80cc7e0c82e07fbd8d9ae8112d9070c4355 (patch)
tree0a9c47e979459375b1882e27571fa91e17f808ba /compiler
parent1262d3f8c03799a04d3c5fcf33d4d4db715ca9a1 (diff)
downloadhaskell-e27eb80cc7e0c82e07fbd8d9ae8112d9070c4355.tar.gz
Force more in NFData Name instance
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
Diffstat (limited to 'compiler')
-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