summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/ClosureMacros.h88
1 files changed, 44 insertions, 44 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 2a0f197218..64e549a641 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -25,25 +25,25 @@
"info pointer" The first word of the closure. Might point
to either the end or the beginning of the
- info table, depending on whether we're using
- the mini interpreter or not. GET_INFO(c)
- retrieves the info pointer of a closure.
+ info table, depending on whether we're using
+ the mini interpreter or not. GET_INFO(c)
+ retrieves the info pointer of a closure.
"info table" The info table structure associated with a
closure. This is always a pointer to the
- beginning of the structure, so we can
- use standard C structure indexing to pull out
- the fields. get_itbl(c) returns a pointer to
- the info table for closure c.
+ beginning of the structure, so we can
+ use standard C structure indexing to pull out
+ the fields. get_itbl(c) returns a pointer to
+ the info table for closure c.
An address of the form xxxx_info points to the end of the info
table or the beginning of the info table depending on whether we're
- mangling or not respectively. So,
+ mangling or not respectively. So,
- c->header.info = xxx_info
+ c->header.info = xxx_info
makes absolute sense, whether mangling or not.
-
+
-------------------------------------------------------------------------- */
INLINE_HEADER void SET_INFO(StgClosure *c, const StgInfoTable *info) {
@@ -103,8 +103,8 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) {
#ifdef PROFILING
#ifdef DEBUG_RETAINER
-/*
- For the sake of debugging, we take the safest way for the moment. Actually, this
+/*
+ For the sake of debugging, we take the safest way for the moment. Actually, this
is useful to check the sanity of heap before beginning retainer profiling.
flip is defined in RetainerProfile.c, and declared as extern in RetainerProfile.h.
Note: change those functions building Haskell objects from C datatypes, i.e.,
@@ -116,7 +116,7 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) {
/*
For retainer profiling only: we do not have to set (c)->header.prof.hp.rs to
NULL | flip (flip is defined in RetainerProfile.c) because even when flip
- is 1, rs is invalid and will be initialized to NULL | flip later when
+ is 1, rs is invalid and will be initialized to NULL | flip later when
the closure *c is visited.
*/
/*
@@ -136,14 +136,14 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) {
#define SET_PROF_HDR(c,ccs)
#endif
-#define SET_HDR(c,_info,ccs) \
- { \
- (c)->header.info = _info; \
- SET_PROF_HDR((StgClosure *)(c),ccs); \
+#define SET_HDR(c,_info,ccs) \
+ { \
+ (c)->header.info = _info; \
+ SET_PROF_HDR((StgClosure *)(c),ccs); \
}
-#define SET_ARR_HDR(c,info,costCentreStack,n_bytes) \
- SET_HDR(c,info,costCentreStack); \
+#define SET_ARR_HDR(c,info,costCentreStack,n_bytes) \
+ SET_HDR(c,info,costCentreStack); \
(c)->bytes = n_bytes;
// Use when changing a closure from one kind to another
@@ -163,17 +163,17 @@ INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) {
INLINE_HEADER StgClosure **
STATIC_LINK(const StgInfoTable *info, StgClosure *p)
-{
+{
switch (info->type) {
case THUNK_STATIC:
- return THUNK_STATIC_LINK(p);
+ return THUNK_STATIC_LINK(p);
case FUN_STATIC:
- return FUN_STATIC_LINK(p);
+ return FUN_STATIC_LINK(p);
case IND_STATIC:
- return IND_STATIC_LINK(p);
+ return IND_STATIC_LINK(p);
default:
- return &(p)->payload[info->layout.payload.ptrs +
- info->layout.payload.nptrs];
+ return &(p)->payload[info->layout.payload.ptrs +
+ info->layout.payload.nptrs];
}
}
@@ -350,58 +350,58 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
switch (info->type) {
case THUNK_0_1:
case THUNK_1_0:
- return sizeofW(StgThunk) + 1;
+ return sizeofW(StgThunk) + 1;
case FUN_0_1:
case CONSTR_0_1:
case FUN_1_0:
case CONSTR_1_0:
- return sizeofW(StgHeader) + 1;
+ return sizeofW(StgHeader) + 1;
case THUNK_0_2:
case THUNK_1_1:
case THUNK_2_0:
- return sizeofW(StgThunk) + 2;
+ return sizeofW(StgThunk) + 2;
case FUN_0_2:
case CONSTR_0_2:
case FUN_1_1:
case CONSTR_1_1:
case FUN_2_0:
case CONSTR_2_0:
- return sizeofW(StgHeader) + 2;
+ return sizeofW(StgHeader) + 2;
case THUNK:
- return thunk_sizeW_fromITBL(info);
+ return thunk_sizeW_fromITBL(info);
case THUNK_SELECTOR:
- return THUNK_SELECTOR_sizeW();
+ return THUNK_SELECTOR_sizeW();
case AP_STACK:
- return ap_stack_sizeW((StgAP_STACK *)p);
+ return ap_stack_sizeW((StgAP_STACK *)p);
case AP:
- return ap_sizeW((StgAP *)p);
+ return ap_sizeW((StgAP *)p);
case PAP:
- return pap_sizeW((StgPAP *)p);
+ return pap_sizeW((StgPAP *)p);
case IND:
case IND_PERM:
- return sizeofW(StgInd);
+ return sizeofW(StgInd);
case ARR_WORDS:
- return arr_words_sizeW((StgArrWords *)p);
+ return arr_words_sizeW((StgArrWords *)p);
case MUT_ARR_PTRS_CLEAN:
case MUT_ARR_PTRS_DIRTY:
case MUT_ARR_PTRS_FROZEN:
case MUT_ARR_PTRS_FROZEN0:
- return mut_arr_ptrs_sizeW((StgMutArrPtrs*)p);
+ return mut_arr_ptrs_sizeW((StgMutArrPtrs*)p);
case SMALL_MUT_ARR_PTRS_CLEAN:
case SMALL_MUT_ARR_PTRS_DIRTY:
case SMALL_MUT_ARR_PTRS_FROZEN:
case SMALL_MUT_ARR_PTRS_FROZEN0:
- return small_mut_arr_ptrs_sizeW((StgSmallMutArrPtrs*)p);
+ return small_mut_arr_ptrs_sizeW((StgSmallMutArrPtrs*)p);
case TSO:
return sizeofW(StgTSO);
case STACK:
return stack_sizeW((StgStack*)p);
case BCO:
- return bco_sizeW((StgBCO *)p);
+ return bco_sizeW((StgBCO *)p);
case TREC_CHUNK:
return sizeofW(StgTRecChunk);
default:
- return sizeW_fromITBL(info);
+ return sizeW_fromITBL(info);
}
}
@@ -425,16 +425,16 @@ EXTERN_INLINE StgWord stack_frame_sizeW( StgClosure *frame )
switch (info->i.type) {
case RET_FUN:
- return sizeofW(StgRetFun) + ((StgRetFun *)frame)->size;
+ return sizeofW(StgRetFun) + ((StgRetFun *)frame)->size;
case RET_BIG:
- return 1 + GET_LARGE_BITMAP(&info->i)->size;
+ return 1 + GET_LARGE_BITMAP(&info->i)->size;
case RET_BCO:
- return 2 + BCO_BITMAP_SIZE((StgBCO *)((P_)frame)[1]);
+ return 2 + BCO_BITMAP_SIZE((StgBCO *)((P_)frame)[1]);
default:
- return 1 + BITMAP_SIZE(info->i.layout.bitmap);
+ return 1 + BITMAP_SIZE(info->i.layout.bitmap);
}
}