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
void
newCAF(StgRegTable *reg, StgClosure* caf)
{
-#ifdef DYNAMIC
if(keepCAFs)
{
// HACK:
RELEASE_SM_LOCK;
}
else
-#endif
{
// Put this CAF on the mutable list for the old generation.
((StgIndStatic *)caf)->saved_info = NULL;
}
}
+// 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