allocateGlobalBinder leaks UniqueSupplys
@mpickering noticed (using
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:
extendNameCachestrict in its
Nameargument as there is little sense deferring this work
new_name_supplyto ensure that we don't unnecessarily allocate a thunk