Commit e74936e3 authored by Simon Marlow's avatar Simon Marlow

Add a 'setKeepCAFs' external function (#3900)

parent f74a195e
......@@ -171,6 +171,9 @@ void newCAF (StgRegTable *reg, StgClosure *);
void newDynCAF (StgRegTable *reg, StgClosure *);
void revertCAFs (void);
// Request that all CAFs are retained indefinitely.
void setKeepCAFs (void);
/* -----------------------------------------------------------------------------
This is the write barrier for MUT_VARs, a.k.a. IORefs. A
MUT_VAR_CLEAN object is not on the mutable list; a MUT_VAR_DIRTY
......
......@@ -268,7 +268,6 @@ freeStorage (void)
void
newCAF(StgRegTable *reg, StgClosure* caf)
{
#ifdef DYNAMIC
if(keepCAFs)
{
// HACK:
......@@ -289,7 +288,6 @@ newCAF(StgRegTable *reg, StgClosure* caf)
RELEASE_SM_LOCK;
}
else
#endif
{
// Put this CAF on the mutable list for the old generation.
((StgIndStatic *)caf)->saved_info = NULL;
......@@ -297,6 +295,13 @@ newCAF(StgRegTable *reg, StgClosure* caf)
}
}
// External API for setting the keepCAFs flag. see #3900.
void
setKeepCAFs (void)
{
keepCAFs = 1;
}
// An alternate version of newCaf which is used for dynamically loaded
// object code in GHCi. In this case we want to retain *all* CAFs in
// the object code, because they might be demanded at any time from an
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment