Safe Haskell | None |
---|---|
Language | Haskell2010 |
GHC.Weak.Finalize
Contents
Synopsis
- setFinalizerExceptionHandler :: (SomeException -> IO ()) -> IO ()
- getFinalizerExceptionHandler :: IO (SomeException -> IO ())
- printToHandleFinalizerExceptionHandler :: Handle -> SomeException -> IO ()
- runFinalizerBatch :: Int -> Array# (State# RealWorld -> State# RealWorld) -> IO ()
Handling exceptions
When an exception is thrown by a finalizer called by the
garbage collector, GHC calls a global handler which can be set with
setFinalizerExceptionHandler
. Note that any exceptions thrown by
this handler will be ignored.
setFinalizerExceptionHandler :: (SomeException -> IO ()) -> IO () Source #
Set the global action called to report exceptions thrown by weak pointer finalizers to the user.
Since: base-4.18.0.0
getFinalizerExceptionHandler :: IO (SomeException -> IO ()) Source #
Get the global action called to report exceptions thrown by weak pointer finalizers to the user.
Since: base-4.18.0.0
printToHandleFinalizerExceptionHandler :: Handle -> SomeException -> IO () Source #
Internal
runFinalizerBatch :: Int -> Array# (State# RealWorld -> State# RealWorld) -> IO () Source #
Deprecated: This function is internal to GHC. It will not be exported in future.
Run a batch of finalizers from the garbage collector. Given an array of finalizers and the length of the array, just call each one in turn.
This is an internal detail of the GHC RTS weak pointer finaliser mechanism. It should no longer be exported from base. There is no good reason to use it. It will be removed in the next major version of base (4.23.*).
See https://github.com/haskell/core-libraries-committee/issues/342