X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStgProf.h;h=9b3ce69a9f7d365b8b4e5f7d1e347b33695bf57a;hb=960a5e6a6f604aa01f5f74b80fb0f61ceffd7ed3;hp=82e552970ee2532803ca1db17da4c61e8753071a;hpb=5bcba9677f6d097ecad2034b7bd039d125eaabdc;p=ghc-hetmet.git diff --git a/ghc/includes/StgProf.h b/ghc/includes/StgProf.h index 82e5529..9b3ce69 100644 --- a/ghc/includes/StgProf.h +++ b/ghc/includes/StgProf.h @@ -12,6 +12,14 @@ /* ----------------------------------------------------------------------------- * Data Structures * ---------------------------------------------------------------------------*/ +/* + * NB. be careful to avoid unwanted padding between fields, by + * putting the 8-byte fields on an 8-byte boundary. Padding can + * vary between C compilers, and we don't take into account any + * possible padding when generating CCS and CC decls in the code + * generator (compiler/codeGen/CgProf.hs). + */ + typedef struct _CostCentre { StgInt ccID; @@ -20,14 +28,13 @@ typedef struct _CostCentre { /* used for accumulating costs at the end of the run... */ StgWord time_ticks; - StgWord64 mem_alloc; + StgWord64 mem_alloc; /* align 8 (see above) */ StgInt is_caf; struct _CostCentre *link; } CostCentre; - typedef struct _CostCentreStack { StgInt ccsID; @@ -35,12 +42,12 @@ typedef struct _CostCentreStack { struct _CostCentreStack *prevStack; struct _IndexTable *indexTable; + StgWord64 scc_count; /* align 8 (see above) */ StgWord selected; - StgWord64 scc_count; StgWord time_ticks; - StgWord64 mem_alloc; + StgWord64 mem_alloc; /* align 8 (see above) */ + StgWord64 inherited_alloc; /* align 8 (see above) */ StgWord inherited_ticks; - StgWord64 inherited_alloc; CostCentre *root; } CostCentreStack; @@ -123,7 +130,7 @@ extern CostCentreStack CCS_OVERHEAD[]; /* Profiling overhead */ extern CostCentre CC_DONT_CARE[]; extern CostCentreStack CCS_DONT_CARE[]; /* shouldn't ever get set */ -#endif // IN_STG_CODE +#endif /* IN_STG_CODE */ extern unsigned int RTS_VAR(CC_ID); /* global ids */ extern unsigned int RTS_VAR(CCS_ID);