summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorDemi Obenour <demiobenour@gmail.com>2017-01-10 13:33:31 -0500
committerBen Gamari <ben@smart-cactus.org>2017-01-10 13:33:38 -0500
commit12ad4d417b89462ba8e19a3c7772a931b3a93f0e (patch)
tree97b5c7e3ba6329ecf99e7431c10d43ee66758d1b /rts/RtsStartup.c
parente8d74321b5b24afcb4230510fd6e4c4ecf6f3e19 (diff)
downloadhaskell-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/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 955ad13b4b..98c1dd290c 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -36,6 +36,7 @@
#include "LinkerInternals.h"
#include "LibdwPool.h"
#include "sm/CNF.h"
+#include "TopHandler.h"
#if defined(PROFILING)
# include "ProfHeap.h"
@@ -242,6 +243,9 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
getStablePtr((StgPtr)runHandlersPtr_closure);
#endif
+ // Initialize the top-level handler system
+ initTopHandler();
+
/* initialise the shared Typeable store */
initGlobalStore();
@@ -414,6 +418,9 @@ hs_exit_(bool wait_foreign)
/* free the Static Pointer Table */
exitStaticPtrTable();
+ /* remove the top-level handler */
+ exitTopHandler();
+
/* free the stable pointer table */
exitStableTables();