Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Javier Neira
GHC
Commits
9af091f7
Commit
9af091f7
authored
3 years ago
by
Ben Gamari
Committed by
Marge Bot
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rts: Factor out built-in GC roots
parent
6c7a4913
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rts/RtsStartup.c
+41
-35
41 additions, 35 deletions
rts/RtsStartup.c
with
41 additions
and
35 deletions
rts/RtsStartup.c
+
41
−
35
View file @
9af091f7
...
@@ -177,6 +177,45 @@ hs_restoreConsoleCP (void)
...
@@ -177,6 +177,45 @@ hs_restoreConsoleCP (void)
Starting up the RTS
Starting up the RTS
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
static
void
initBuiltinGcRoots
(
void
)
{
/* Add some GC roots for things in the base package that the RTS
* knows about. We don't know whether these turn out to be CAFs
* or refer to CAFs, but we have to assume that they might.
*
* Because these stable pointers will retain any CAF references in
* these closures `Id`s of these can be safely marked as non-CAFFY
* in the compiler.
*/
getStablePtr
((
StgPtr
)
runIO_closure
);
getStablePtr
((
StgPtr
)
runNonIO_closure
);
getStablePtr
((
StgPtr
)
flushStdHandles_closure
);
getStablePtr
((
StgPtr
)
runFinalizerBatch_closure
);
getStablePtr
((
StgPtr
)
stackOverflow_closure
);
getStablePtr
((
StgPtr
)
heapOverflow_closure
);
getStablePtr
((
StgPtr
)
unpackCString_closure
);
getStablePtr
((
StgPtr
)
blockedIndefinitelyOnMVar_closure
);
getStablePtr
((
StgPtr
)
nonTermination_closure
);
getStablePtr
((
StgPtr
)
blockedIndefinitelyOnSTM_closure
);
getStablePtr
((
StgPtr
)
allocationLimitExceeded_closure
);
getStablePtr
((
StgPtr
)
cannotCompactFunction_closure
);
getStablePtr
((
StgPtr
)
cannotCompactPinned_closure
);
getStablePtr
((
StgPtr
)
cannotCompactMutable_closure
);
getStablePtr
((
StgPtr
)
nestedAtomically_closure
);
getStablePtr
((
StgPtr
)
runSparks_closure
);
getStablePtr
((
StgPtr
)
ensureIOManagerIsRunning_closure
);
getStablePtr
((
StgPtr
)
interruptIOManager_closure
);
getStablePtr
((
StgPtr
)
ioManagerCapabilitiesChanged_closure
);
#if !defined(mingw32_HOST_OS)
getStablePtr
((
StgPtr
)
blockedOnBadFD_closure
);
getStablePtr
((
StgPtr
)
runHandlersPtr_closure
);
#else
getStablePtr
((
StgPtr
)
processRemoteCompletion_closure
);
#endif
}
void
void
hs_init
(
int
*
argc
,
char
**
argv
[])
hs_init
(
int
*
argc
,
char
**
argv
[])
{
{
...
@@ -317,41 +356,8 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
...
@@ -317,41 +356,8 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
/* initialise the stable name table */
/* initialise the stable name table */
initStableNameTable
();
initStableNameTable
();
/* Add some GC roots for things in the base package that the RTS
/* create StablePtrs for builtin GC roots*/
* knows about. We don't know whether these turn out to be CAFs
initBuiltinGcRoots
();
* or refer to CAFs, but we have to assume that they might.
*
* Because these stable pointers will retain any CAF references in
* these closures `Id`s of these can be safely marked as non-CAFFY
* in the compiler.
*/
getStablePtr
((
StgPtr
)
runIO_closure
);
getStablePtr
((
StgPtr
)
runNonIO_closure
);
getStablePtr
((
StgPtr
)
flushStdHandles_closure
);
getStablePtr
((
StgPtr
)
runFinalizerBatch_closure
);
getStablePtr
((
StgPtr
)
stackOverflow_closure
);
getStablePtr
((
StgPtr
)
heapOverflow_closure
);
getStablePtr
((
StgPtr
)
unpackCString_closure
);
getStablePtr
((
StgPtr
)
blockedIndefinitelyOnMVar_closure
);
getStablePtr
((
StgPtr
)
nonTermination_closure
);
getStablePtr
((
StgPtr
)
blockedIndefinitelyOnSTM_closure
);
getStablePtr
((
StgPtr
)
allocationLimitExceeded_closure
);
getStablePtr
((
StgPtr
)
cannotCompactFunction_closure
);
getStablePtr
((
StgPtr
)
cannotCompactPinned_closure
);
getStablePtr
((
StgPtr
)
cannotCompactMutable_closure
);
getStablePtr
((
StgPtr
)
nestedAtomically_closure
);
getStablePtr
((
StgPtr
)
runSparks_closure
);
getStablePtr
((
StgPtr
)
ensureIOManagerIsRunning_closure
);
getStablePtr
((
StgPtr
)
interruptIOManager_closure
);
getStablePtr
((
StgPtr
)
ioManagerCapabilitiesChanged_closure
);
#if !defined(mingw32_HOST_OS)
getStablePtr
((
StgPtr
)
blockedOnBadFD_closure
);
getStablePtr
((
StgPtr
)
runHandlersPtr_closure
);
#else
getStablePtr
((
StgPtr
)
processRemoteCompletion_closure
);
#endif
/*
/*
* process any foreign exports which were registered while loading the
* process any foreign exports which were registered while loading the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment