/* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.48 2003/03/21 16:18:39 sof Exp $
+ * $Id: Storage.h,v 1.52 2003/04/22 16:25:12 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
-------------------------------------------------------------------------- */
#define ExtendNursery(hp,hplim) \
- (CurrentNursery->free = (P_)(hp)+1, \
+ (CloseNursery(hp), \
CurrentNursery->link == NULL ? rtsFalse : \
(CurrentNursery = CurrentNursery->link, \
OpenNursery(hp,hplim), \
rtsTrue))
-extern void PleaseStopAllocating(void);
-
/* -----------------------------------------------------------------------------
Performing Garbage Collection
// We zero out the slop when PROFILING is on.
// #ifndef DEBUG
#if !defined(DEBUG) && !defined(PROFILING)
-#define updateWithIndirection(info, p1, p2) \
+#define updateWithIndirection(info, ind_info, p1, p2, and_then) \
{ \
bdescr *bd; \
\
bd = Bdescr((P_)p1); \
if (bd->gen_no == 0) { \
((StgInd *)p1)->indirectee = p2; \
- SET_INFO(p1,&stg_IND_info); \
+ SET_INFO(p1,ind_info); \
TICK_UPD_NEW_IND(); \
+ and_then; \
} else { \
((StgIndOldGen *)p1)->indirectee = p2; \
if (info != &stg_BLACKHOLE_BQ_info) { \
} \
SET_INFO(p1,&stg_IND_OLDGEN_info); \
TICK_UPD_OLD_IND(); \
+ and_then; \
} \
}
#elif defined(PROFILING)
// the invariants that every closure keeps its creation time in the profiling
// field. So, we call LDV_recordCreate().
-#define updateWithIndirection(info, p1, p2) \
+#define updateWithIndirection(info, ind_info, p1, p2, and_then) \
{ \
bdescr *bd; \
\
bd = Bdescr((P_)p1); \
if (bd->gen_no == 0) { \
((StgInd *)p1)->indirectee = p2; \
- SET_INFO(p1,&stg_IND_info); \
+ SET_INFO(p1,ind_info); \
LDV_recordCreate((p1)); \
TICK_UPD_NEW_IND(); \
+ and_then; \
} else { \
((StgIndOldGen *)p1)->indirectee = p2; \
if (info != &stg_BLACKHOLE_BQ_info) { \
} \
SET_INFO(p1,&stg_IND_OLDGEN_info); \
LDV_recordCreate((p1)); \
+ and_then; \
} \
}
* already have been updated (the mutable list will get messed up
* otherwise).
*/
-#define updateWithIndirection(info, p1, p2) \
+#define updateWithIndirection(info, ind_info, p1, p2, and_then) \
{ \
bdescr *bd; \
\
bd = Bdescr((P_)p1); \
if (bd->gen_no == 0) { \
((StgInd *)p1)->indirectee = p2; \
- SET_INFO(p1,&stg_IND_info); \
+ SET_INFO(p1,ind_info); \
TICK_UPD_NEW_IND(); \
+ and_then; \
} else { \
if (info != &stg_BLACKHOLE_BQ_info) { \
{ \
((StgIndOldGen *)p1)->indirectee = p2; \
SET_INFO(p1,&stg_IND_OLDGEN_info); \
TICK_UPD_OLD_IND(); \
+ and_then; \
} \
}
#endif
static __inline__ StgWord tso_sizeW ( StgTSO *tso )
{ return TSO_STRUCT_SIZEW + tso->stack_size; }
+static __inline__ StgWord bco_sizeW ( StgBCO *bco )
+{ return bco->size; }
+
/* -----------------------------------------------------------------------------
Sizes of stack frames
-------------------------------------------------------------------------- */
case RET_DYN:
{
StgRetDyn *dyn = (StgRetDyn *)frame;
- return sizeofW(StgRetDyn) + RET_DYN_SIZE +
+ return sizeofW(StgRetDyn) + RET_DYN_BITMAP_SIZE +
+ RET_DYN_NONPTR_REGS_SIZE +
GET_PTRS(dyn->liveness) + GET_NONPTRS(dyn->liveness);
}