diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-25 15:58:45 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-25 16:00:10 +0000 |
commit | 2c6ef2fec2813e5bec03a9939231b12e7007c193 (patch) | |
tree | 35924e607a0c350bbe2308baccbbcc002dc0d8fe | |
parent | bc038c3bd45ee99db9fba23a823a906735740200 (diff) | |
download | haskell-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.hs | 2 |
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 |