Loading apps/decoder.c +2 −6 Original line number Diff line number Diff line Loading @@ -1505,9 +1505,7 @@ static ivas_error decodeG192( } #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading Loading @@ -1978,9 +1976,7 @@ static ivas_error decodeVoIP( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading apps/encoder.c +1 −3 Original line number Diff line number Diff line Loading @@ -717,9 +717,7 @@ int main( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading apps/renderer.c +1 −3 Original line number Diff line number Diff line Loading @@ -999,9 +999,7 @@ int main( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading lib_debug/wmc_auto.c +41 −45 Original line number Diff line number Diff line Loading @@ -341,12 +341,6 @@ void update_wmops( void ) start_cnt = ops_cnt; if ( heap_allocation_call_tree_size > 0 ) { /* update intra-frame heap memory and inter-frame heap memory*/ update_mem(); } /* increment frame counter */ update_cnt++; Loading Loading @@ -554,6 +548,11 @@ void print_wmops( void ) #define ROUND_BLOCK_SIZE( n ) ( ( ( n ) + BLOCK_ROUNDING - 1 ) & ~( BLOCK_ROUNDING - 1 ) ) #define IS_CALLOC( str ) ( str[0] == 'c' ) #ifdef MEM_COUNT_DETAILS const char *csv_filename = "mem_analysis.csv"; static FILE *fid_csv_filename = NULL; #endif typedef struct { char function_name[MAX_FUNCTION_NAME_LENGTH + 1]; Loading Loading @@ -688,6 +687,25 @@ void reset_mem( Counting_Size cnt_size ) size_wc_inter_frame_heap = 0; location_wc_inter_frame_heap = -1; #ifdef MEM_COUNT_DETAILS /* Check, if the .csv file has already been opened */ if ( fid_csv_filename == NULL ) { fid_csv_filename = fopen( csv_filename, "wb" ); if ( fid_csv_filename == NULL ) { fprintf( stderr, "\nCannot open %s!\n\n", csv_filename ); exit( -1 ); } } else { /* reset file */ rewind( fid_csv_filename ); } #endif return; } Loading Loading @@ -960,6 +978,11 @@ void *mem_alloc( ptr_record->block_size = size; ptr_record->total_block_size += size; #ifdef MEM_COUNT_DETAILS /* Export heap memory allocation record to the .csv file */ fprintf( fid_csv_filename, "A,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif if ( ptr_record->frame_allocated != -1 ) { fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Error: Attempt to Allocate the Same Memory Block with Freeing it First!" ); Loading Loading @@ -1295,6 +1318,11 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ) /* Check, if Out-Of-Bounds Access has been Detected */ ptr_record->OOB_Flag = mem_check_OOB( ptr_record ); #ifdef MEM_COUNT_DETAILS /* Export heap memory de-allocation record to the .csv file */ fprintf( fid_csv_filename, "D,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif /* De-Allocate Memory Block */ tmp_ptr = (char *) ptr; tmp_ptr -= BLOCK_ROUNDING; Loading Loading @@ -1713,45 +1741,6 @@ static void mem_count_summary( void ) return; } /*-------------------------------------------------------------------* * export_mem() * * Export detailed (per-item) information about heap memory usage to a .csv file *--------------------------------------------------------------------*/ void export_mem( const char *csv_filename ) { int i; static FILE *fid = NULL; allocator_record *record_ptr; if ( csv_filename == NULL || strcmp( csv_filename, "" ) == 0 ) { return; } /* Check, if the .csv file has already been opened */ if ( fid == NULL ) { fid = fopen( csv_filename, "wb" ); if ( fid == NULL ) { fprintf( stderr, "\nCannot open %s!\n\n", csv_filename ); exit( -1 ); } } /* Export individual heap memory records to a .csv file */ for ( i = 0; i < Num_Records; i++ ) { record_ptr = &( allocation_list[i] ); fprintf( fid, "%s:%d,%d;", record_ptr->name, record_ptr->lineno, record_ptr->block_size ); } fprintf( fid, "\n" ); return; } #endif /*-------------------------------------------------------------------* Loading Loading @@ -1902,6 +1891,13 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) free( list_wc_inter_frame_heap ); } #ifdef MEM_COUNT_DETAILS if ( fid_csv_filename != NULL ) { fclose( fid_csv_filename ); } #endif return; } Loading lib_debug/wmc_auto.h +0 −4 Original line number Diff line number Diff line Loading @@ -1007,9 +1007,6 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ); void reset_mem( Counting_Size cnt_size ); void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ); #ifdef MEM_COUNT_DETAILS void export_mem( const char *csv_filename ); #endif int push_stack( const char *filename, const char *fctname ); int pop_stack( const char *filename, const char *fctname ); Loading @@ -1031,7 +1028,6 @@ void reset_stack( void ); #define free_( ptr ) free( ptr ) #define reset_mem( cnt_size ) #define print_mem( Const_Data_PROM_Table ) #define export_mem( csv_filename ) #define push_stack( file, fct ) #define pop_stack( file, fct ) Loading Loading
apps/decoder.c +2 −6 Original line number Diff line number Diff line Loading @@ -1505,9 +1505,7 @@ static ivas_error decodeG192( } #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading Loading @@ -1978,9 +1976,7 @@ static ivas_error decodeVoIP( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading
apps/encoder.c +1 −3 Original line number Diff line number Diff line Loading @@ -717,9 +717,7 @@ int main( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading
apps/renderer.c +1 −3 Original line number Diff line number Diff line Loading @@ -999,9 +999,7 @@ int main( #ifdef WMOPS update_wmops(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif update_mem(); #endif } Loading
lib_debug/wmc_auto.c +41 −45 Original line number Diff line number Diff line Loading @@ -341,12 +341,6 @@ void update_wmops( void ) start_cnt = ops_cnt; if ( heap_allocation_call_tree_size > 0 ) { /* update intra-frame heap memory and inter-frame heap memory*/ update_mem(); } /* increment frame counter */ update_cnt++; Loading Loading @@ -554,6 +548,11 @@ void print_wmops( void ) #define ROUND_BLOCK_SIZE( n ) ( ( ( n ) + BLOCK_ROUNDING - 1 ) & ~( BLOCK_ROUNDING - 1 ) ) #define IS_CALLOC( str ) ( str[0] == 'c' ) #ifdef MEM_COUNT_DETAILS const char *csv_filename = "mem_analysis.csv"; static FILE *fid_csv_filename = NULL; #endif typedef struct { char function_name[MAX_FUNCTION_NAME_LENGTH + 1]; Loading Loading @@ -688,6 +687,25 @@ void reset_mem( Counting_Size cnt_size ) size_wc_inter_frame_heap = 0; location_wc_inter_frame_heap = -1; #ifdef MEM_COUNT_DETAILS /* Check, if the .csv file has already been opened */ if ( fid_csv_filename == NULL ) { fid_csv_filename = fopen( csv_filename, "wb" ); if ( fid_csv_filename == NULL ) { fprintf( stderr, "\nCannot open %s!\n\n", csv_filename ); exit( -1 ); } } else { /* reset file */ rewind( fid_csv_filename ); } #endif return; } Loading Loading @@ -960,6 +978,11 @@ void *mem_alloc( ptr_record->block_size = size; ptr_record->total_block_size += size; #ifdef MEM_COUNT_DETAILS /* Export heap memory allocation record to the .csv file */ fprintf( fid_csv_filename, "A,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif if ( ptr_record->frame_allocated != -1 ) { fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Error: Attempt to Allocate the Same Memory Block with Freeing it First!" ); Loading Loading @@ -1295,6 +1318,11 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ) /* Check, if Out-Of-Bounds Access has been Detected */ ptr_record->OOB_Flag = mem_check_OOB( ptr_record ); #ifdef MEM_COUNT_DETAILS /* Export heap memory de-allocation record to the .csv file */ fprintf( fid_csv_filename, "D,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif /* De-Allocate Memory Block */ tmp_ptr = (char *) ptr; tmp_ptr -= BLOCK_ROUNDING; Loading Loading @@ -1713,45 +1741,6 @@ static void mem_count_summary( void ) return; } /*-------------------------------------------------------------------* * export_mem() * * Export detailed (per-item) information about heap memory usage to a .csv file *--------------------------------------------------------------------*/ void export_mem( const char *csv_filename ) { int i; static FILE *fid = NULL; allocator_record *record_ptr; if ( csv_filename == NULL || strcmp( csv_filename, "" ) == 0 ) { return; } /* Check, if the .csv file has already been opened */ if ( fid == NULL ) { fid = fopen( csv_filename, "wb" ); if ( fid == NULL ) { fprintf( stderr, "\nCannot open %s!\n\n", csv_filename ); exit( -1 ); } } /* Export individual heap memory records to a .csv file */ for ( i = 0; i < Num_Records; i++ ) { record_ptr = &( allocation_list[i] ); fprintf( fid, "%s:%d,%d;", record_ptr->name, record_ptr->lineno, record_ptr->block_size ); } fprintf( fid, "\n" ); return; } #endif /*-------------------------------------------------------------------* Loading Loading @@ -1902,6 +1891,13 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) free( list_wc_inter_frame_heap ); } #ifdef MEM_COUNT_DETAILS if ( fid_csv_filename != NULL ) { fclose( fid_csv_filename ); } #endif return; } Loading
lib_debug/wmc_auto.h +0 −4 Original line number Diff line number Diff line Loading @@ -1007,9 +1007,6 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ); void reset_mem( Counting_Size cnt_size ); void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ); #ifdef MEM_COUNT_DETAILS void export_mem( const char *csv_filename ); #endif int push_stack( const char *filename, const char *fctname ); int pop_stack( const char *filename, const char *fctname ); Loading @@ -1031,7 +1028,6 @@ void reset_stack( void ); #define free_( ptr ) free( ptr ) #define reset_mem( cnt_size ) #define print_mem( Const_Data_PROM_Table ) #define export_mem( csv_filename ) #define push_stack( file, fct ) #define pop_stack( file, fct ) Loading