X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FStorage.c;h=f0506cd77cd8037a8774b8c723e2153f770f98f6;hb=ef4b4901c726308393a246952fb466c8cbb04578;hp=9320232e97dd1c2ce9f480613455914c3da10b40;hpb=0f10e070774287eb7cb07689207777a64cc31414;p=ghc-hetmet.git diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 9320232..f0506cd 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -13,18 +13,15 @@ #include "PosixSource.h" #include "Rts.h" + +#include "Storage.h" #include "RtsUtils.h" -#include "RtsFlags.h" #include "Stats.h" -#include "Hooks.h" #include "BlockAlloc.h" -#include "MBlock.h" #include "Weak.h" #include "Sanity.h" #include "Arena.h" -#include "OSThreads.h" #include "Capability.h" -#include "Storage.h" #include "Schedule.h" #include "RetainerProfile.h" // for counting memory blocks (memInventory) #include "OSMem.h" @@ -32,7 +29,6 @@ #include "GC.h" #include "Evac.h" -#include #include #include "ffi.h" @@ -71,6 +67,7 @@ step *nurseries = NULL; /* array of nurseries, >1 only if THREADED_RTS * Mutex sm_mutex; #endif +static void allocNurseries ( void ); static void initStep (step *stp, int g, int s) @@ -284,6 +281,7 @@ freeStorage (void) closeMutex(&sm_mutex); #endif stgFree(nurseries); + freeGcThreads(); } /* ----------------------------------------------------------------------------- @@ -332,6 +330,7 @@ newCAF(StgClosure* caf) { ACQUIRE_SM_LOCK; +#ifdef DYNAMIC if(keepCAFs) { // HACK: @@ -349,6 +348,7 @@ newCAF(StgClosure* caf) caf_list = caf; } else +#endif { /* Put this CAF on the mutable list for the old generation. * This is a HACK - the IND_STATIC closure doesn't really have @@ -439,7 +439,7 @@ assignNurseriesToCapabilities (void) #endif } -void +static void allocNurseries( void ) { nat i; @@ -852,7 +852,7 @@ void setTSOLink (Capability *cap, StgTSO *tso, StgTSO *target) { bdescr *bd; - if ((tso->flags & (TSO_DIRTY|TSO_LINK_DIRTY)) == 0) { + if (tso->dirty == 0 && (tso->flags & TSO_LINK_DIRTY) == 0) { tso->flags |= TSO_LINK_DIRTY; bd = Bdescr((StgPtr)tso); if (bd->gen_no > 0) recordMutableCap((StgClosure*)tso,cap,bd->gen_no); @@ -864,11 +864,11 @@ void dirty_TSO (Capability *cap, StgTSO *tso) { bdescr *bd; - if ((tso->flags & (TSO_DIRTY|TSO_LINK_DIRTY)) == 0) { + if (tso->dirty == 0 && (tso->flags & TSO_LINK_DIRTY) == 0) { bd = Bdescr((StgPtr)tso); if (bd->gen_no > 0) recordMutableCap((StgClosure*)tso,cap,bd->gen_no); } - tso->flags |= TSO_DIRTY; + tso->dirty = 1; } /*