SET_PROF_HDR((StgClosure *)(c),ccs); \
}
-#define SET_ARR_HDR(c,info,costCentreStack,n_words) \
+#define SET_ARR_HDR(c,info,costCentreStack,n_bytes) \
SET_HDR(c,info,costCentreStack); \
- (c)->words = n_words;
+ (c)->bytes = n_bytes;
+
+// Use when changing a closure from one kind to another
+#define OVERWRITE_INFO(c, new_info) \
+ LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC((StgClosure *)(c)); \
+ SET_INFO((c), (new_info)); \
+ LDV_RECORD_CREATE(c);
/* -----------------------------------------------------------------------------
How to get hold of the static link field for a static closure.
{ return sizeofW(StgSelector); }
INLINE_HEADER StgOffset BLACKHOLE_sizeW ( void )
-{ return sizeofW(StgHeader)+MIN_PAYLOAD_SIZE; }
+{ return sizeofW(StgInd); } // a BLACKHOLE is a kind of indirection
/* --------------------------------------------------------------------------
Sizes of closures
INLINE_HEADER StgOffset pap_sizeW( StgPAP* x )
{ return PAP_sizeW(x->n_args); }
+INLINE_HEADER StgWord arr_words_words( StgArrWords* x)
+{ return ROUNDUP_BYTES_TO_WDS(x->bytes); }
+
INLINE_HEADER StgOffset arr_words_sizeW( StgArrWords* x )
-{ return sizeofW(StgArrWords) + x->words; }
+{ return sizeofW(StgArrWords) + arr_words_words(x); }
INLINE_HEADER StgOffset mut_arr_ptrs_sizeW( StgMutArrPtrs* x )
{ return sizeofW(StgMutArrPtrs) + x->size; }
return pap_sizeW((StgPAP *)p);
case IND:
case IND_PERM:
- case IND_OLDGEN:
- case IND_OLDGEN_PERM:
return sizeofW(StgInd);
case ARR_WORDS:
return arr_words_sizeW((StgArrWords *)p);