ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        with_gc
      
      
        
          | 
            Last change
 on this file since 5fe35d6 was             fb114fa1, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago           | 
        
        
          | 
             
more refactoring of parser code 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100755
               
             
           | 
        
        
          | 
            File size:
            325 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #!/usr/bin/nawk -f
 | 
|---|
| 2 | 
 | 
|---|
| 3 | BEGIN {
 | 
|---|
| 4 |         print "Freed but not allocated:"
 | 
|---|
| 5 | }
 | 
|---|
| 6 | 
 | 
|---|
| 7 | /malloc/ {
 | 
|---|
| 8 |         alloc[ $2 ] = $3;
 | 
|---|
| 9 | }
 | 
|---|
| 10 | 
 | 
|---|
| 11 | /free/ {
 | 
|---|
| 12 |         if ( $2 in alloc ) {
 | 
|---|
| 13 |                 delete alloc[ $2 ];
 | 
|---|
| 14 |         } else {
 | 
|---|
| 15 |                 print $2;
 | 
|---|
| 16 |         } # if
 | 
|---|
| 17 | }
 | 
|---|
| 18 | 
 | 
|---|
| 19 | END {
 | 
|---|
| 20 |         print "Allocated but not freed:"
 | 
|---|
| 21 |         for ( i in alloc ) {
 | 
|---|
| 22 |                 print i, alloc[ i ];
 | 
|---|
| 23 |                 total += alloc[ i ]
 | 
|---|
| 24 |         } # for
 | 
|---|
| 25 |         print "total", total;
 | 
|---|
| 26 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.