Ignore:
Timestamp:
Apr 11, 2017, 6:35:59 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
3720bf8f
Parents:
f674479 (diff), 4f57930 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-vbench.cpp

    rf674479 rda1c772  
     1#include <algorithm>
    12#include <stdlib.h>
    23#include "bench.hpp"
    34#include "cpp-vstack.hpp"
     5#include "object.hpp"
    46
    57int main(int argc, char** argv) {
     
    2022        )
    2123
    22         integer sum;
     24        integer max;
    2325        REPEAT_TIMED( "pop_int",
    24                 sum += t.pop()->as<integer>();
     26                max = std::max( max, t.pop()->as<integer>() );
     27        )
     28
     29        stack s2;
     30        REPEAT_TIMED( "push_bool_char",
     31                s2.push( std::make_unique<pair>( std::make_unique<boolean>( rand() & 0x1 ),
     32                        std::make_unique<character>( rand() & 0x7F ) ) );
     33        )
     34
     35        stack t2;
     36        TIMED( "copy_bool_char",
     37                t2 = s2;
     38        )
     39
     40        TIMED( "clear_bool_char",
     41                s2.clear();
     42        )
     43
     44        pair max2 = { std::make_unique<boolean>(false), std::make_unique<character>('\0') };
     45        REPEAT_TIMED( "pop_bool_char",
     46                max2 = std::max( max2, t2.pop()->as<pair>() );
    2547        )
    2648}
Note: See TracChangeset for help on using the changeset viewer.