Changeset 4ea1c6d for libcfa/src


Ignore:
Timestamp:
Nov 30, 2019, 11:10:33 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
6e7de84
Parents:
4cae032
Message:

turn on unfreed storage warning message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/heap.cfa

    r4cae032 r4ea1c6d  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Nov 24 17:56:15 2019
    13 // Update Count     : 638
     12// Last Modified On : Fri Nov 29 17:33:58 2019
     13// Update Count     : 641
    1414//
    1515
     
    7171
    7272
    73 // static bool traceHeapTerm = false;
    74 
    75 // inline bool traceHeapTerm() {
    76 //      return traceHeapTerm;
    77 // } // traceHeapTerm
    78 
    79 // bool traceHeapTermOn() {
    80 //      bool temp = traceHeapTerm;
    81 //      traceHeapTerm = true;
    82 //      return temp;
    83 // } // traceHeapTermOn
    84 
    85 // bool traceHeapTermOff() {
    86 //      bool temp = traceHeapTerm;
    87 //      traceHeapTerm = false;
    88 //      return temp;
    89 // } // traceHeapTermOff
    90 
    91 
    9273enum {
    9374        // Define the default extension heap amount in units of bytes. When the uC++ supplied heap reaches the brk address,
     
    11596        if ( allocFree != 0 ) {
    11697                // DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT.
    117                 // char helpText[512];
    118                 // int len = snprintf( helpText, sizeof(helpText), "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
    119                 //                                      "Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
    120                 //                                      (long int)getpid(), allocFree, allocFree ); // always print the UNIX pid
    121                 // __cfaabi_dbg_bits_write( STDERR_FILENO, helpText, len ); // print debug/nodebug
     98                char helpText[512];
     99                int len = snprintf( helpText, sizeof(helpText), "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
     100                                                        "Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
     101                                                        (long int)getpid(), allocFree, allocFree ); // always print the UNIX pid
     102                __cfaabi_bits_write( STDERR_FILENO, helpText, len ); // print debug/nodebug
    122103        } // if
    123104} // prtUnfreed
Note: See TracChangeset for help on using the changeset viewer.