X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStorage.h;h=9257bcd3b52567f9f15ccca5a9dab0d775f46a86;hb=87c93cf56c83abf0148c91d5972dbe65dc72c38a;hp=09b1b048817e8cfaf3af899ebfb9a84a76b7e0f4;hpb=fa4ee2f36b0b685c3cd1935f1a56bfb796aca0e2;p=ghc-hetmet.git diff --git a/includes/Storage.h b/includes/Storage.h index 09b1b04..9257bcd 100644 --- a/includes/Storage.h +++ b/includes/Storage.h @@ -114,9 +114,13 @@ extern void freeStorage(void); /* ----------------------------------------------------------------------------- Generic allocation - StgPtr allocate(nat n) Allocates a chunk of contiguous store - n words long, returning a pointer to - the first word. Always succeeds. + StgPtr allocateInGen(generation *g, nat n) + Allocates a chunk of contiguous store + n words long in generation g, + returning a pointer to the first word. + Always succeeds. + + StgPtr allocate(nat n) Equaivalent to allocateInGen(g0) StgPtr allocateLocal(Capability *cap, nat n) Allocates memory from the nursery in @@ -150,6 +154,7 @@ extern void freeStorage(void); -------------------------------------------------------------------------- */ extern StgPtr allocate ( nat n ); +extern StgPtr allocateInGen ( generation *g, nat n ); extern StgPtr allocateLocal ( Capability *cap, nat n ); extern StgPtr allocatePinned ( nat n ); extern lnat allocatedBytes ( void ); @@ -185,7 +190,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 @@ -303,7 +308,7 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); ((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type < N_CLOSURE_TYPES) #define LOOKS_LIKE_CLOSURE_PTR(p) \ - (LOOKS_LIKE_INFO_PTR(((StgClosure *)(p))->header.info)) + (LOOKS_LIKE_INFO_PTR((UNTAG_CLOSURE((StgClosure *)(p)))->header.info)) /* ----------------------------------------------------------------------------- Macros for calculating how big a closure will be (used during allocation) @@ -362,7 +367,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) { @@ -392,6 +397,7 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info) case AP_STACK: return ap_stack_sizeW((StgAP_STACK *)p); case AP: + return ap_sizeW((StgAP *)p); case PAP: return pap_sizeW((StgPAP *)p); case IND: @@ -428,7 +434,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)); @@ -457,7 +463,6 @@ INLINE_HEADER StgWord stack_frame_sizeW( StgClosure *frame ) return sizeofW(StgRetFun) + ((StgRetFun *)frame)->size; case RET_BIG: - case RET_VEC_BIG: return 1 + GET_LARGE_BITMAP(&info->i)->size; case RET_BCO: @@ -476,13 +481,14 @@ extern void allocNurseries ( void ); extern void resetNurseries ( void ); extern void resizeNurseries ( nat blocks ); extern void resizeNurseriesFixed ( nat blocks ); -extern void tidyAllocateLists ( void ); 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 );