X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStorage.h;h=12be6d19d033e24f6164ee67fe578ac3333f58e5;hb=911b42b27ad5f039465d14052460e2d9dde053ab;hp=0b9337808338ef4913a0675a09b73aff7ceca38c;hpb=9cef40bd4dd2536c7a370a1a9b78461c152805cc;p=ghc-hetmet.git diff --git a/includes/Storage.h b/includes/Storage.h index 0b93378..12be6d1 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); @@ -181,7 +185,7 @@ extern void freeExec (void *p); MarkRoot(StgClosure *p) Returns the new location of the root. -------------------------------------------------------------------------- */ -extern void GarbageCollect(void (*get_roots)(evac_fn),rtsBool force_major_gc); +extern void GarbageCollect(rtsBool force_major_gc); /* ----------------------------------------------------------------------------- Generational garbage collection support @@ -358,7 +362,7 @@ INLINE_HEADER StgWord tso_sizeW ( StgTSO *tso ) INLINE_HEADER StgWord bco_sizeW ( StgBCO *bco ) { return bco->size; } -STATIC_INLINE nat +INLINE_HEADER nat closure_sizeW_ (StgClosure *p, StgInfoTable *info) { switch (info->type) { @@ -424,7 +428,7 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info) } // The definitive way to find the size, in words, of a heap-allocated closure -STATIC_INLINE nat +INLINE_HEADER nat closure_sizeW (StgClosure *p) { return closure_sizeW_(p, get_itbl(p)); @@ -479,6 +483,8 @@ extern lnat countNurseryBlocks ( void ); Functions from GC.c -------------------------------------------------------------------------- */ +typedef void (*evac_fn)(StgClosure **); + extern void threadPaused ( Capability *cap, StgTSO * ); extern StgClosure * isAlive ( StgClosure *p ); extern void markCAFs ( evac_fn evac );