Add call stack cleanup

This commit is contained in:
Patrick Lipka 2025-08-08 15:39:30 +02:00
parent 8d5d145d0f
commit b61b35b812
1 changed files with 10 additions and 0 deletions

View File

@ -99,8 +99,18 @@ static void cleanup_function_stats(void* item){
}
}
static void cleanup_stack_info(void* item){
stack_info_t* stack = (stack_info_t*)item;
if (stack->stack_path){
rvprof_free(stack->stack_path, strlen(stack->stack_path)+1);
stack->stack_path = NULL;
}
}
// acutal dynamic array implementations:
IMPLEMENT_DYNAMIC_ARRAY(region_t, region, INITIAL_REGIONS, cleanup_region_entry)
IMPLEMENT_DYNAMIC_ARRAY(symbol_entry_t, symbol, INITIAL_SYMBOLS, cleanup_symbol_entry)
IMPLEMENT_DYNAMIC_ARRAY(function_stats_t, function_stats, INITIAL_FUNCTIONS, cleanup_function_stats)
IMPLEMENT_DYNAMIC_ARRAY(stack_info_t, stack_info, INITIAL_STACKS, cleanup_stack_info)