Ignore:
Timestamp:
Apr 15, 2017, 7:09:59 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c57d1935
Parents:
308880c
Message:

Minor cleanup, also filled in benchmark source appendix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cfa-bench.c

    r308880c ra381b46  
    1010        int max = 0;
    1111        stack(int) s, t;
     12
    1213        REPEAT_TIMED( "push_int", push( &s, _i ); )
    1314        TIMED( "copy_int", t = s; )
    1415        TIMED( "clear_int", clear( &s ); )
    15         REPEAT_TIMED( "pop_int", max = max( max, pop( &t ) ); )
     16        REPEAT_TIMED( "pop_int",
     17                int x = pop(&t);
     18                if ( x > max ) { max = x; } )
    1619        REPEAT_TIMED( "print_int", print( out, _i, ":", _i, "\n" ); )
    1720
    1821        stack(pair(_Bool, char)) s1, t1;
    1922        pair(_Bool, char) max = { (_Bool)0, '\0' };
     23
    2024        REPEAT_TIMED( "push_pair", push( &s1, (pair(_Bool, char)){ _i & 1, _i &0x7F } ); )
    2125        TIMED( "copy_pair", t1 = s1; )
    2226        TIMED( "clear_pair", clear( &s1 ); )
    23         REPEAT_TIMED( "pop_pair", max = max( max, pop( &t1 ) ); )
     27        REPEAT_TIMED( "pop_pair",
     28                pair(_Bool, char) x = pop(&t1);
     29                if ( x > max ) { max = x; } )
    2430        REPEAT_TIMED( "print_pair",
    25                  print( out, (pair(_Bool, char)){  _i & 1, _i &0x7F }, ":", (pair(_Bool, char)){  _i & 1, _i &0x7F }, "\n" ); )
     31                 print( out, (pair(_Bool, char)){  _i & 1, _i &0x7F }, ":",
     32                        (pair(_Bool, char)){  _i & 1, _i &0x7F }, "\n" ); )
    2633        fclose(out);
    2734}
Note: See TracChangeset for help on using the changeset viewer.