From 2c6ef2fec2813e5bec03a9939231b12e7007c193 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 25 Jan 2023 15:58:45 +0000 Subject: 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 --- compiler/GHC/Types/Name.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1