diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-11-21 23:39:51 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-11-21 23:40:55 -0500 |
commit | 3f86d715310fa5df911c5e411c4268db57f54498 (patch) | |
tree | 160a590a80d93f730f7ff95cbb30f2bcbd80abd8 /libraries/base/GHC/Conc | |
parent | 451aeac3b07f171f148995717d0d9a1eefe08f0e (diff) | |
download | haskell-wip/stack-overflow-size.tar.gz |
Diffstat (limited to 'libraries/base/GHC/Conc')
-rw-r--r-- | libraries/base/GHC/Conc/Sync.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs index b587da0785..9041850573 100644 --- a/libraries/base/GHC/Conc/Sync.hs +++ b/libraries/base/GHC/Conc/Sync.hs @@ -412,7 +412,7 @@ real_handler se | Just BlockedIndefinitelyOnMVar <- fromException se = return () | Just BlockedIndefinitelyOnSTM <- fromException se = return () | Just ThreadKilled <- fromException se = return () - | Just StackOverflow <- fromException se = reportStackOverflow + | Just (StackOverflow' num_words)<- fromException se = reportStackOverflow num_words | otherwise = reportError se {- | 'killThread' raises the 'ThreadKilled' exception in the given @@ -938,10 +938,11 @@ sharedCAF a get_or_set = else do freeStablePtr stable_ref deRefStablePtr (castPtrToStablePtr (castPtr ref2)) -reportStackOverflow :: IO () -reportStackOverflow = do - ThreadId tid <- myThreadId - c_reportStackOverflow tid +{- | @since TODO +-} +reportStackOverflow :: Word# -> IO () +reportStackOverflow stack_size = + c_reportStackOverflow stack_size reportError :: SomeException -> IO () reportError ex = do @@ -951,7 +952,7 @@ reportError ex = do -- SUP: Are the hooks allowed to re-enter Haskell land? If so, remove -- the unsafe below. foreign import ccall unsafe "reportStackOverflow" - c_reportStackOverflow :: ThreadId# -> IO () + c_reportStackOverflow :: Word# -> IO () foreign import ccall unsafe "reportHeapOverflow" reportHeapOverflow :: IO () |