Commit b75d126e authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Austin Seipp

rts: remove stable-names from hashtable upon free

This fixes #9078.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 4dac3a41
......@@ -246,6 +246,7 @@ STATIC_INLINE void
freeSnEntry(snEntry *sn)
{
ASSERT(sn->sn_obj == NULL);
removeHashTable(addrToStableHash, (W_)sn->old, NULL);
sn->addr = (P_)stable_name_free;
stable_name_free = sn;
}
......
module Main where
import Control.Monad
import System.Mem.StableName
main :: IO ()
main = replicateM_ 500000 (makeStableName foo)
foo :: Int
foo = 1
cap 0: initialised
cap 0: shutting down
......@@ -227,3 +227,6 @@ test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']),
# The ghci way gets confused by the RTS options
test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, [''])
# I couldn't reproduce 9078 with the -threaded runtime, but could easily
# with the non-threaded one.
test('T9078', [ omit_ways(threaded_ways) ], compile_and_run, ['-with-rtsopts="-DS" -debug'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment