% % (c) The GRASP/AQUA Project, Glasgow University, 1995 % %************************************************************************ %* * \section{How data is handled within the RTS} %* * %************************************************************************ \begin{code} #ifndef RTSTYPES_H #define RTSTYPES_H \end{code} For all of you boolean crazies out there... \begin{code} typedef enum { rtsFalse = 0, rtsTrue } rtsBool; \end{code} Hash tables for GUM are ADTs. Peek inside, and I'll have to kill you. The same goes for hash list cells. \begin{code} #ifdef PAR typedef struct hashtable HashTable; typedef struct hashlist HashList; typedef double REAL_TIME; typedef int GLOBAL_TASK_ID; typedef int PACKET; typedef int OPCODE; /* Global addresses, in all their glory */ typedef struct { union { P_ plc; struct { GLOBAL_TASK_ID gtid; int slot; } gc; } loc; unsigned weight; } globalAddr; /* (GA, LA) pairs */ typedef struct gala { globalAddr ga; P_ la; struct gala *next; rtsBool preferred; } GALA; #endif #if defined(GRAN) typedef unsigned long TIME; typedef unsigned char PROC; typedef unsigned char EVTTYPE; #endif #if defined(PAR) typedef W_ TIME; typedef GLOBAL_TASK_ID PROC; #endif \end{code} A cost centre is represented by a pointer to a static structure containing the @label@, @module@, @group@, and the statistical meters we are collecting. \begin{code} #if defined(PROFILING) || defined(CONCURRENT) typedef struct cc { struct cc *registered; /* list of registered cost centres */ hash_t index_val; /* hashed index -- initially UNHASHED */ char *label; /* cost centre label */ char *module; /* name of module in which _scc_ occurs */ char *group; /* name of group in which _scc_ occurs */ char is_subsumed; /* 'B' => *not* a CAF/dict/sub cc */ /* 's' => *is* a subsumed cc */ /* 'c' => *is* a CAF cc */ /* 'd' => *is* a dictionary cc */ /* IS_CAF_OR_DICT_OR_SUB_CC tests for lowercase bit */ /* Statistics Gathered */ W_ scc_count; /* no of scc expression instantiations */ W_ sub_scc_count; /* no of scc's set inside this cc */ W_ sub_cafcc_count; /* no of scc's set inside this cc */ W_ sub_dictcc_count; /* no of scc's set inside this cc */ #if defined(PROFILING_DETAIL_COUNTS) W_ thunk_count; /* no of {thunk,function,PAP} enters */ W_ function_count; /* in this cost centre */ W_ pap_count; W_ mem_allocs; /* no of allocations */ W_ subsumed_fun_count; /* no of functions subsumed */ W_ subsumed_caf_count; /* no of caf/dict funs subsumed */ W_ caffun_subsumed; /* no of subsumes from this caf/dict */ #endif W_ time_ticks; /* no of timer interrupts -- current interval */ W_ prev_ticks; /* no of timer interrupts -- previous intervals */ W_ mem_alloc; /* no of words allocated (excl CC_HDR) */ /* Heap Profiling by Cost Centre */ W_ selected; /* is this cost centre selected */ } *CostCentre; #if defined(PROFILING_DETAIL_COUNTS) #define INIT_CC_STATS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 #else #define INIT_CC_STATS 0,0,0,0,0,0,0,0 #endif #endif /* defined(PROFILING) || defined(CONCURRENT) */ \end{code} This structure will need to be expanded change as the statistics we gather improve. \begin{code} #endif /* ! RTSTYPES_H */ \end{code}