X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=includes%2FStorage.h;h=238b858406dca541636c9c3b3a14b31c988d0b12;hp=92a856c96392dc6a9d0b83ff211a987abf92387c;hb=d7d755865a3849be26a468a3fa430ff96c8e9e0c;hpb=6015a94f9108a502150565577b66c23650796639 diff --git a/includes/Storage.h b/includes/Storage.h index 92a856c..238b858 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 ); @@ -299,7 +304,10 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); -------------------------------------------------------------------------- */ #define LOOKS_LIKE_INFO_PTR(p) \ - (p && ((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type != INVALID_OBJECT && \ + (p && LOOKS_LIKE_INFO_PTR_NOT_NULL(p)) + +#define LOOKS_LIKE_INFO_PTR_NOT_NULL(p) \ + (((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type != INVALID_OBJECT && \ ((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type < N_CLOSURE_TYPES) #define LOOKS_LIKE_CLOSURE_PTR(p) \ @@ -476,7 +484,6 @@ 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 ); /* -----------------------------------------------------------------------------