X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStorage.h;h=09b1b048817e8cfaf3af899ebfb9a84a76b7e0f4;hb=fa4ee2f36b0b685c3cd1935f1a56bfb796aca0e2;hp=3a6bb2fde1ce6ea628d7af61959348f99a9ecef0;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/includes/Storage.h b/includes/Storage.h index 3a6bb2f..09b1b04 100644 --- a/includes/Storage.h +++ b/includes/Storage.h @@ -118,6 +118,12 @@ extern void freeStorage(void); n words long, returning a pointer to the first word. Always succeeds. + StgPtr allocateLocal(Capability *cap, nat n) + Allocates memory from the nursery in + the current Capability. This can be + done without taking a global lock, + unlike allocate(). + StgPtr allocatePinned(nat n) Allocates a chunk of contiguous store n words long, which is at a fixed address (won't be moved by GC). @@ -137,18 +143,16 @@ extern void freeStorage(void); rtsBool doYouWantToGC(void) Returns True if the storage manager is ready to perform a GC, False otherwise. - lnat allocated_bytes(void) Returns the number of bytes allocated + lnat allocatedBytes(void) Returns the number of bytes allocated via allocate() since the last GC. Used in the reporting of statistics. - THREADED_RTS: allocate and doYouWantToGC can be used from STG code, they are - surrounded by a mutex. -------------------------------------------------------------------------- */ extern StgPtr allocate ( nat n ); extern StgPtr allocateLocal ( Capability *cap, nat n ); extern StgPtr allocatePinned ( nat n ); -extern lnat allocated_bytes ( void ); +extern lnat allocatedBytes ( void ); extern bdescr * RTS_VAR(small_alloc_list); extern bdescr * RTS_VAR(large_alloc_list); @@ -166,6 +170,10 @@ doYouWantToGC( void ) return (alloc_blocks >= alloc_blocks_lim); } +/* memory allocator for executable memory */ +extern void *allocateExec (nat bytes); +extern void freeExec (void *p); + /* ----------------------------------------------------------------------------- Performing Garbage Collection @@ -402,14 +410,18 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info) return tso_sizeW((StgTSO *)p); case BCO: return bco_sizeW((StgBCO *)p); - case TVAR_WAIT_QUEUE: - return sizeofW(StgTVarWaitQueue); + case TVAR_WATCH_QUEUE: + return sizeofW(StgTVarWatchQueue); case TVAR: return sizeofW(StgTVar); case TREC_CHUNK: return sizeofW(StgTRecChunk); case TREC_HEADER: return sizeofW(StgTRecHeader); + case ATOMIC_INVARIANT: + return sizeofW(StgAtomicInvariant); + case INVARIANT_CHECK_QUEUE: + return sizeofW(StgInvariantCheckQueue); default: return sizeW_fromITBL(info); }