- 
                Notifications
    You must be signed in to change notification settings 
- Fork 24
Closed
Description
If a value is reified with reifyTypeable and then never reflected, its underlying StablePtr is leaked and never freed.
Example reproducer:
{- cabal:
build-depends: base, reflection
-}
import Control.Exception
import Data.Reflection
go :: Int -> IO ()
go 0 = pure ()
go n = reifyTypeable n $ \p -> do
  --evaluate (reflect p)
  go (n - 1)
main = go 10000000Running this on my machine exhibits 160,031,904 bytes maximum residency (10 sample(s)). Uncommenting the evaluate reduces it to 35,984 bytes maximum residency (1 sample(s)).
Metadata
Metadata
Assignees
Labels
No labels