From: simonmar Date: Mon, 10 Dec 2001 14:00:35 +0000 (+0000) Subject: [project @ 2001-12-10 14:00:35 by simonmar] X-Git-Tag: Approximately_9120_patches~432 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ccaf7b66fc79e464b4e26f4ae62cb92ef7ba4b0f;p=ghc-hetmet.git [project @ 2001-12-10 14:00:35 by simonmar] Make the OccName and SrcLoc fields of a Name strict, to eliminate space leaks. This doesn't hurt performance. --- diff --git a/ghc/compiler/basicTypes/Name.lhs b/ghc/compiler/basicTypes/Name.lhs index 2cd0ef0..c47d480 100644 --- a/ghc/compiler/basicTypes/Name.lhs +++ b/ghc/compiler/basicTypes/Name.lhs @@ -52,11 +52,15 @@ import Outputable \begin{code} data Name = Name { n_sort :: NameSort, -- What sort of name it is - n_occ :: OccName, -- Its occurrence name + n_occ :: !OccName, -- Its occurrence name n_uniq :: Unique, - n_loc :: SrcLoc -- Definition site + n_loc :: !SrcLoc -- Definition site } +-- NOTE: we make the n_loc field strict to eliminate some potential +-- (and real!) space leaks, due to the fact that we don't look at +-- the SrcLoc in a Name all that often. + data NameSort = Global Module -- (a) TyCon, Class, their derived Ids, dfun Id -- (b) Imported Id