Commit 93829284 authored by malenov's avatar malenov
Browse files

change memory consumption from words to bytes

parent 2ad7a310
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ int main(
#endif
#ifdef WMOPS
    reset_wmops();
    reset_mem( USE_32BITS );
    reset_mem( USE_BYTES );
#endif

    /*------------------------------------------------------------------------------------------*
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ int main(
#endif
#ifdef WMOPS
    reset_wmops();
    reset_mem( USE_32BITS );
    reset_mem( USE_BYTES );
#endif

    initArgStruct( &arg );
+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ int main(

#ifdef WMOPS
    reset_wmops();
    reset_mem( USE_32BITS );
    reset_mem( USE_BYTES );
#endif

    for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
+15 −5
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ allocator_record *allocation_list = NULL;

static int Num_Records, Max_Num_Records;
static size_t Stat_Cnt_Size = USE_BYTES;
static const char *Count_Unit[] = { "bytes", "words", "words" };
static const char *Count_Unit[] = { "bytes", "words", "words", "words" };

static int32_t wc_ram_size, wc_ram_frame;
static int32_t current_heap_size;
@@ -1896,7 +1896,16 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] )

        for ( i = 0; i < nElem; i++ )
        {
            fprintf( stdout, "Program ROM size (%s): %d instruction words\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size );
            if ( Stat_Cnt_Size > 0 )
            {
                /* words */
                fprintf( stdout, "Program ROM size (%s): %d words\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size );
            }
            else
            {
                /* bytes */
                fprintf( stdout, "Program ROM size (%s): %d bytes\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size << Stat_Cnt_Size );
            }
        }

        for ( i = 0; i < nElem; i++ )
@@ -1985,11 +1994,12 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] )
    mem_count_summary();
#endif

    if ( Stat_Cnt_Size > 0 )
    if ( Stat_Cnt_Size == 0 )
    {
        fprintf( stdout, "\nNote: 1 word = %d bits\n", 8 << Stat_Cnt_Size );
        fprintf( stdout, "This is an optimistic estimate of memory consumption assuming that each variable type is stored with sizeof(type) bits\n" );
        /* bytes */
        fprintf( stdout, "\nNote: The Program ROM size is calculated under the assumption that 1 instruction word is stored with %d bytes (%d bits)\n", 1 << Stat_Cnt_Size, 8 << Stat_Cnt_Size );
    }
    fprintf( stdout, "Note: The Data ROM size is calculated using the sizeof(type) built-in function\n" );

    if ( n_items_wc_intra_frame_heap > 0 )
    {
+2 −1
Original line number Diff line number Diff line
@@ -981,7 +981,8 @@ typedef enum
{
    USE_BYTES = 0,
    USE_16BITS = 1,
    USE_32BITS = 2
    USE_32BITS = 2,
    USE_64BITS = 3
} Counting_Size;

#if ( defined( _WIN32 ) && ( _MSC_VER <= 1800 ) && ( _MSC_VER >= 1300 ) )