allocateGlobalBinder leaks UniqueSupplys
@mpickering noticed (using ghc-debug) that GHC.Iface.Env.allocateGlobalBinder currently leaks UniqueSupplys. The reason is that the the Name is not forced by extendNameCache, resulting in a Name thunk which captures a (Unique, UniqueSupply) thunk.
Likewise, he also found that we allocate chains of NameCaches as the record update constructing new_name_supply is not forced.
I think the solution is two-fold:
- make
extendNameCachestrict in itsNameargument as there is little sense deferring this work - make
allocateGlobalBinderstrict innew_name_supplyto ensure that we don't unnecessarily allocate a thunk
Edited by Ben Gamari