1/*--------------------------------------------------------------------*/ 2/*--- Callgrind ---*/ 3/*--- ct_costs.h ---*/ 4/*--- (C) 2004, Josef Weidendorfer ---*/ 5/*--------------------------------------------------------------------*/ 6 7#ifndef CT_COSTS 8#define CT_COSTS 9 10#include "pub_tool_basics.h" 11 12#define CLG_(str) VGAPPEND(vgCallgrind_,str) 13 14extern UInt CLG_(costarray_entries); 15extern UInt CLG_(costarray_chunks); 16 17/* Array of 64bit costs. This is separated from other structs 18 * to support a dynamic number of costs for a cost item. 19 * Chunks are allocated on demand, and deallocated at program termination. 20 */ 21typedef struct _CostChunk CostChunk; 22struct _CostChunk { 23 Int size; 24 Int used; 25 CostChunk *next, *prev; 26 ULong data[0]; 27}; 28 29/* Allocate a number of 64bit cost values. 30 * Typically used from ct_events.c */ 31ULong* CLG_(get_costarray)(Int size); 32void CLG_(free_costarrays)(void); 33 34 35#endif /* CT_COSTS */ 36