diff options
author | Demi Obenour <demiobenour@gmail.com> | 2017-01-10 13:33:31 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-01-10 13:33:38 -0500 |
commit | 12ad4d417b89462ba8e19a3c7772a931b3a93f0e (patch) | |
tree | 97b5c7e3ba6329ecf99e7431c10d43ee66758d1b /rts/TopHandler.h | |
parent | e8d74321b5b24afcb4230510fd6e4c4ecf6f3e19 (diff) | |
download | haskell-12ad4d417b89462ba8e19a3c7772a931b3a93f0e.tar.gz |
Throw an exception on heap overflow
This changes heap overflow to throw a HeapOverflow exception instead of
killing the process.
Test Plan: GHC CI
Reviewers: simonmar, austin, hvr, erikd, bgamari
Reviewed By: simonmar, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2790
GHC Trac Issues: #1791
Diffstat (limited to 'rts/TopHandler.h')
-rw-r--r-- | rts/TopHandler.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/rts/TopHandler.h b/rts/TopHandler.h new file mode 100644 index 0000000000..fddebb05ef --- /dev/null +++ b/rts/TopHandler.h @@ -0,0 +1,27 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 2016 + * + * Top-level handler support + * + * ---------------------------------------------------------------------------*/ + +#include <BeginPrivate.h> +#include <rts/Types.h> +#include <rts/storage/Closures.h> +#include <stg/Types.h> +#include <rts/Stable.h> +// Initialize the top handler subsystem +void initTopHandler(void); + +// Exit the top handler subsystem +void exitTopHandler(void); + +// Get the thread that handles ctrl-c, etc +// Returns NULL if there is no such thread +StgTSO *getTopHandlerThread(void); + +#include <EndPrivate.h> + +// Called from Haskell +void rts_setMainThread(StgWeak *ptr); |