diff options
author | Simon Marlow <marlowsd@gmail.com> | 2014-06-09 09:18:12 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2015-04-07 09:57:49 +0100 |
commit | a7ab161602aa0b5833d22c66e64eebb1d9275235 (patch) | |
tree | 22db09216cbd2165359d8add08b5cf4cdbf5041f /rts/RtsStartup.c | |
parent | 72092904e0ac1725c05c0447e1efe7ab541faa95 (diff) | |
download | haskell-a7ab161602aa0b5833d22c66e64eebb1d9275235.tar.gz |
Replace hooks by callbacks in RtsConfig (#8785)
Summary:
Hooks rely on static linking semantics, and are broken by -Bsymbolic
which we need when using dynamic linking.
Test Plan: Built it
Reviewers: austin, hvr, tibbe
Differential Revision: https://phabricator.haskell.org/D8
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r-- | rts/RtsStartup.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index 190088274e..c50bb07f75 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -69,12 +69,6 @@ static int hs_init_count = 0; static void flushStdHandles(void); -const RtsConfig defaultRtsConfig = { - .rts_opts_enabled = RtsOptsSafeOnly, - .rts_opts = NULL, - .rts_hs_main = rtsFalse -}; - /* ----------------------------------------------------------------------------- Initialise floating point unit on x86 (currently disabled; See Note [x86 Floating point precision] in compiler/nativeGen/X86/Instr.hs) @@ -148,7 +142,7 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config) initRtsFlagsDefaults(); /* Call the user hook to reset defaults, if present */ - defaultsHook(); + rts_config.defaultsHook(); /* Parse the flags, separating the RTS flags from the programs args */ if (argc == NULL || argv == NULL) { @@ -156,12 +150,10 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config) int my_argc = 1; char *my_argv[] = { "<unknown>", NULL }; setFullProgArgv(my_argc,my_argv); - setupRtsFlags(&my_argc, my_argv, - rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main); + setupRtsFlags(&my_argc, my_argv, rts_config); } else { setFullProgArgv(*argc,*argv); - setupRtsFlags(argc, *argv, - rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main); + setupRtsFlags(argc, *argv, rts_config); #ifdef DEBUG /* load debugging symbols for current binary */ @@ -328,7 +320,7 @@ hs_exit_(rtsBool wait_foreign) /* start timing the shutdown */ stat_startExit(); - OnExitHook(); + rtsConfig.onExitHook(); flushStdHandles(); |