File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ module Control.RefCount (
2929
3030 -- * Test API
3131 , checkForgottenRefs
32+ , ignoreForgottenRefs
3233 ) where
3334
3435import Control.DeepSeq
3536import Control.Exception (assert )
36- import Control.Monad (when )
37+ import Control.Monad (void , when )
3738import Control.Monad.Class.MonadThrow
3839import Control.Monad.Primitive
3940import Data.Primitive.PrimVar
@@ -546,6 +547,10 @@ checkForgottenRefs = do
546547 where
547548#endif
548549
550+ -- | Run 'checkForgottenRefs', but ignore the resulting exception, if any.
551+ ignoreForgottenRefs :: IO ()
552+ ignoreForgottenRefs = void $ try @ _ @ SomeException $ checkForgottenRefs
553+
549554#ifdef NO_IGNORE_ASSERTS
550555performMajorGCWithBlockingIfAvailable :: IO ()
551556performMajorGCWithBlockingIfAvailable = do
You can’t perform that action at this time.
0 commit comments