Commit 7a65f9e1 authored by GHC GitLab CI's avatar GHC GitLab CI Committed by Marge Bot

rts: Introduce highMemDynamic

parent 2782487f
......@@ -230,6 +230,10 @@ void revertCAFs (void);
// (preferably use RtsConfig.keep_cafs instead)
void setKeepCAFs (void);
// Let the runtime know that all the CAFs in high mem are not
// to be retained. Useful in conjunction with loadNativeObj
void setHighMemDynamic (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
......@@ -45,6 +45,7 @@ StgIndStatic *dyn_caf_list = NULL;
StgIndStatic *debug_caf_list = NULL;
StgIndStatic *revertible_caf_list = NULL;
bool keepCAFs;
bool highMemDynamic;
W_ large_alloc_lim; /* GC if n_large_blocks in any nursery
* reaches this. */
......@@ -518,7 +519,7 @@ newCAF(StgRegTable *reg, StgIndStatic *caf)
bh = lockCAF(reg, caf);
if (!bh) return NULL;
if(keepCAFs && !(highMemDynamic && (void*) caf > (void*) 0x80000000))
// Note [dyn_caf_list]
// If we are in GHCi _and_ we are using dynamic libraries,
......@@ -572,6 +573,12 @@ setKeepCAFs (void)
keepCAFs = 1;
setHighMemDynamic (void)
highMemDynamic = 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