Add API: memory
This commit is contained in:
parent
f858647ad1
commit
2364c82e2d
|
@ -122,9 +122,36 @@ typedef struct{
|
|||
uint64_t total_program_tiem;
|
||||
uint64_t total_program_cycles;
|
||||
size_t total_memory_allocated;
|
||||
|
||||
} rvprof_context_t;
|
||||
|
||||
|
||||
// ONLY GLOBAL VARIABLE
|
||||
extern rvprof_context_t g_rvprof;
|
||||
|
||||
|
||||
// internal API
|
||||
|
||||
// memory management
|
||||
void* rvprof_malloc(size_t size);
|
||||
void* rvprof_reallovc(void* ptr, size_t old_size, size_t new_size);
|
||||
void rvprof_free(void* ptr, size_t size);
|
||||
|
||||
// dynamic array management
|
||||
int region_array_ensure_capacity(region_array_t* arr, int needed);
|
||||
int function_stats_array_ensure_capacity(function_stats_array_t* arr, int needed);
|
||||
int stack_info_array_ensure_capacity(stack_info_array_t* arr, int needed);
|
||||
int symbol_array_ensure_capacity(symbol_array_t* arr, int needed);
|
||||
|
||||
void region_array_cleanup(region_array_t* arr);
|
||||
void function_stats_array_cleanup(function_stats_array_t* arr);
|
||||
void stack_info_array_cleanup(stack_info_array_t* arr);
|
||||
void symbol_array_cleanup(symbol_array_t* arr);
|
||||
|
||||
// memory operations: fyunction statistics
|
||||
int rvprof_memory_add_stack_id_to_function(int func_id, int stack_id);
|
||||
int rvprof_memory_add_caller_to_function(int func_id, const char* caller);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue