X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Frts%2FStorage.c;h=28ccf79f50b180685c35fb5e9ce815ab44648fe4;hb=91b07216be1cb09230b7d1b417899ddea8620ff3;hp=e44348f5f4a2a5414ee3e0001554a1287279e597;hpb=da69fa9c5047c5b0d05bdb05eaddefa1eb5d5a36;p=ghc-hetmet.git diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index e44348f..28ccf79 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -759,6 +759,22 @@ allocatePinned( nat n ) } /* ----------------------------------------------------------------------------- + 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 + is. When written to, a MUT_VAR_CLEAN turns into a MUT_VAR_DIRTY + and is put on the mutable list. + -------------------------------------------------------------------------- */ + +void +dirty_MUT_VAR(StgClosure *p) +{ + if (p->header.info == &stg_MUT_VAR_CLEAN_info) { + p->header.info = &stg_MUT_VAR_DIRTY_info; + recordMutable(p); + } +} + +/* ----------------------------------------------------------------------------- Allocation functions for GMP. These all use the allocate() interface - we can't have any garbage