Ignore:
Timestamp:
Aug 5, 2023, 9:41:11 AM (12 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
502a107
Parents:
028c2c6
Message:

missing add of terminating thread-heap statistics to master heap, check for environment variable CFA_MALLOC_STATS and print heap statistics at program termination

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/heap.cfa

    r028c2c6 ra47fe52  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 28 18:27:53 2023
    13 // Update Count     : 1612
     12// Last Modified On : Wed Aug  2 18:48:30 2023
     13// Update Count     : 1614
    1414//
    1515
     
    527527
    528528        #ifdef __STATISTICS__
     529        heapMaster.stats += heapManager->stats;                         // retain this heap's statistics
    529530        heapMaster.threads_exited += 1;
    530531        #endif // __STATISTICS__
     
    564565                fclose( stdin ); fclose( stdout );                              // free buffer storage
    565566          if ( ! cfa_main_returned ) return;                            // do not check unfreed storage if exit called
     567
     568                #ifdef __STATISTICS__
     569                if ( getenv( "CFA_MALLOC_STATS" ) ) {                   // check for external printing
     570                        malloc_stats();
     571                } // if
     572                #endif // __STATISTICS__
    566573
    567574                #ifdef __CFA_DEBUG__
Note: See TracChangeset for help on using the changeset viewer.