Home | History | Annotate | Download | only in callgrind
      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 
     14 extern UInt CLG_(costarray_entries);
     15 extern 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  */
     21 typedef struct _CostChunk CostChunk;
     22 struct _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 */
     31 ULong* CLG_(get_costarray)(Int size);
     32 void CLG_(free_costarrays)(void);
     33 
     34 
     35 #endif /* CT_COSTS */
     36