Ignore:
Timestamp:
Apr 10, 2017, 3:17:29 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
b715c9a
Parents:
b0fedd4 (diff), b276be5 (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rb0fedd4 r7a054e82  
    22#include "bench.h"
    33#include "c-stack.h"
     4
     5void* copy_int( void* p ) {
     6        int* q = malloc(sizeof(int));
     7        *q = *(int*)p;
     8        return q;
     9}
    410
    511int main(int argc, char** argv) {
     
    713
    814        struct stack s = new_stack();
    9 
    1015        REPEAT_TIMED( "push_int",
    1116                int* x = malloc(sizeof(int));
     
    1419        )
    1520
    16         clear_stack(&s);
     21        struct stack t;
     22        TIMED( "copy_int",
     23                copy_stack(&t, &s, copy_int);
     24        )
     25
     26        TIMED( "clear_int",
     27                clear_stack(&s);
     28        )
     29
     30        int sum;
     31        REPEAT_TIMED( "pop_int",
     32                int* x = pop_stack(&t);
     33                sum += *x;
     34                free(x);
     35        )
    1736}
Note: See TracChangeset for help on using the changeset viewer.