Changeset 29db723 for doc/papers/general/evaluation
- Timestamp:
- Mar 8, 2018, 11:04:14 PM (6 years ago)
- 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:
- 81e8ab0, e59f0bf
- Parents:
- deb52a0
- Location:
- doc/papers/general/evaluation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cfa-stack.c
rdeb52a0 r29db723 2 2 #include "cfa-stack.h" 3 3 4 forall( otype T) struct stack_node {4 forall( otype T ) struct stack_node { 5 5 T value; 6 6 stack_node(T) * next; 7 7 }; 8 8 9 forall( otype T) void ?{}( stack(T) & s ) { (s.head){ 0 }; }9 forall( otype T ) void ?{}( stack(T) & s ) { (s.head){ 0 }; } 10 10 11 forall( otype T) void ?{}( stack(T) & s, stack(T) t ) {11 forall( otype T ) void ?{}( stack(T) & s, stack(T) t ) { 12 12 stack_node(T) ** crnt = &s.head; 13 13 for ( stack_node(T) * next = t.head; next; next = next->next ) { … … 19 19 } 20 20 21 forall( otype T) stack(T) ?=?( stack(T) & s, stack(T) t ) {21 forall( otype T ) stack(T) ?=?( stack(T) & s, stack(T) t ) { 22 22 if ( s.head == t.head ) return s; 23 23 clear( s ); … … 26 26 } 27 27 28 forall( otype T) void ^?{}( stack(T) & s) { clear( s ); }28 forall( otype T ) void ^?{}( stack(T) & s) { clear( s ); } 29 29 30 forall( otype T) _Bool empty( const stack(T) & s ) { return s.head == 0; }30 forall( otype T ) _Bool empty( const stack(T) & s ) { return s.head == 0; } 31 31 32 forall( otype T) void push( stack(T) & s, T value ) with( s ) {33 stack_node(T) * n = alloc();32 forall( otype T ) void push( stack(T) & s, T value ) with( s ) { 33 stack_node(T) * n = alloc(); 34 34 (*n){ value, head }; 35 35 head = n; 36 36 } 37 37 38 forall( otype T) T pop( stack(T) & s ) with( s ) {38 forall( otype T ) T pop( stack(T) & s ) with( s ) { 39 39 stack_node(T) * n = head; 40 40 head = n->next; 41 T x= n->value;41 T v = n->value; 42 42 ^(*n){}; 43 43 free( n ); 44 return x;44 return v; 45 45 } 46 46 47 forall( otype T) void clear( stack(T) & s ) with( s ) {47 forall( otype T ) void clear( stack(T) & s ) with( s ) { 48 48 for ( stack_node(T) * next = head; next; ) { 49 49 stack_node(T) * crnt = next; -
doc/papers/general/evaluation/cfa-stack.h
rdeb52a0 r29db723 1 1 #pragma once 2 2 3 forall( otype T) struct stack_node;4 forall( otype T) struct stack {3 forall( otype T ) struct stack_node; 4 forall( otype T ) struct stack { 5 5 stack_node(T) * head; 6 6 }; 7 7 8 forall( otype T) void ?{}( stack(T) & s );9 forall( otype T) void ?{}( stack(T) & s, stack(T) t );10 forall( otype T) stack(T) ?=?( stack(T) & s, stack(T) t );11 forall( otype T) void ^?{}( stack(T) & s);8 forall( otype T ) void ?{}( stack(T) & s ); 9 forall( otype T ) void ?{}( stack(T) & s, stack(T) t ); 10 forall( otype T ) stack(T) ?=?( stack(T) & s, stack(T) t ); 11 forall( otype T ) void ^?{}( stack(T) & s); 12 12 13 forall( otype T) _Bool empty( const stack(T) & s );14 forall( otype T) void push( stack(T) & s, T value );15 forall( otype T) T pop( stack(T) & s );16 forall( otype T) void clear( stack(T) & s );13 forall( otype T ) _Bool empty( const stack(T) & s ); 14 forall( otype T ) void push( stack(T) & s, T value ); 15 forall( otype T ) T pop( stack(T) & s ); 16 forall( otype T ) void clear( stack(T) & s ); -
doc/papers/general/evaluation/timing.gp
rdeb52a0 r29db723 22 22 SCALE=1000 23 23 set ylabel "seconds" 24 set yrange [0:10] 25 26 set label "26.5" at 7.125,10.5 24 27 25 28 # set datafile separator ","
Note: See TracChangeset
for help on using the changeset viewer.