Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
7b1b3279
Commit
7b1b3279
authored
Aug 09, 2006
by
Simon Marlow
Browse files
make exit() overridable, for use in DLLs
See #753
parent
444006bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/RtsAPI.h
View file @
7b1b3279
...
...
@@ -43,6 +43,8 @@ extern void shutdownHaskellAndExit ( int exitCode );
extern
void
getProgArgv
(
int
*
argc
,
char
**
argv
[]
);
extern
void
setProgArgv
(
int
argc
,
char
*
argv
[]
);
/* exit() override */
extern
void
(
*
exitFn
)(
int
);
/* ----------------------------------------------------------------------------
Locking.
...
...
rts/RtsStartup.c
View file @
7b1b3279
...
...
@@ -459,6 +459,8 @@ shutdownHaskellAndExit(int n)
static
int
exit_started
=
rtsFalse
;
#endif
void
(
*
exitFn
)(
int
)
=
0
;
void
stg_exit
(
int
n
)
{
...
...
@@ -471,5 +473,7 @@ stg_exit(int n)
IF_PAR_DEBUG
(
verbose
,
debugBelch
(
"==-- stg_exit %d on [%x]..."
,
n
,
mytid
));
shutdownParallelSystem
(
n
);
#endif
if
(
exitFn
)
(
*
exitFn
)(
n
);
exit
(
n
);
}
rts/Storage.c
View file @
7b1b3279
...
...
@@ -127,7 +127,7 @@ initStorage( void )
RtsFlags
.
GcFlags
.
minAllocAreaSize
>
RtsFlags
.
GcFlags
.
maxHeapSize
)
{
errorBelch
(
"maximum heap size (-M) is smaller than minimum alloc area size (-A)"
);
exit
(
1
)
;
RtsFlags
.
GcFlags
.
minAllocAreaSize
=
RtsFlags
.
GcFlags
.
maxHeapSize
;
}
initBlockAllocator
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment