Add dynamic array structure
This commit is contained in:
parent
88ce871058
commit
1b5e488b45
|
@ -58,7 +58,7 @@ typedef struct {
|
||||||
char caller [MAX_NAME_LEN];
|
char caller [MAX_NAME_LEN];
|
||||||
uint64_t total_inclusive_time;
|
uint64_t total_inclusive_time;
|
||||||
uint64_t total_exclusive_time;
|
uint64_t total_exclusive_time;
|
||||||
uint64_t total_inclusive_cycles;
|
uint64_t total_inclusive_cycles;
|
||||||
uint64_t total_exclusive_cycles;
|
uint64_t total_exclusive_cycles;
|
||||||
uint64_t call_count;
|
uint64_t call_count;
|
||||||
int* stack_ids;
|
int* stack_ids;
|
||||||
|
@ -71,6 +71,18 @@ typedef struct {
|
||||||
double inclusive_percent;
|
double inclusive_percent;
|
||||||
} function_stats_t;
|
} function_stats_t;
|
||||||
|
|
||||||
|
// dynamic array structure (could switch to a more sophisticated container + template if we would move to C++ at some point)
|
||||||
|
#define DECLARE_DYNAMIC_ARRAY(type, name) \
|
||||||
|
typedef struct { \
|
||||||
|
type* data; \
|
||||||
|
int size; \
|
||||||
|
int capacity; \
|
||||||
|
} name##_array_t;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_ARRAY(region_t, region);
|
||||||
|
DECLARE_DYNAMIC_ARRAY(function_stats_t, function_stats);
|
||||||
|
DECLARE_DYNAMIC_ARRAY(symbol_entry_t, symbol);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue