Changeset c87cd93
- Timestamp:
- Apr 17, 2017, 3:47:07 PM (7 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:
- 4ae83a4b
- Parents:
- 33e22da
- Location:
- doc/generic_types
- Files:
-
- 18 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/Makefile
r33e22da rc87cd93 34 34 35 35 CFILES = c-bench.c bench.h $(COBJS:.o=.h) $(COBJS:.o=.c) 36 CPPFILES = cpp-bench.cpp bench.hpp cpp-stack.hpp cpp-p rint.hpp36 CPPFILES = cpp-bench.cpp bench.hpp cpp-stack.hpp cpp-pair.hpp cpp-print.hpp 37 37 CPPVFILES = cpp-vbench.cpp bench.hpp object.hpp $(CPPVOBJS:.o=.hpp) $(CPPVOBJS:.o=.cpp) cpp-vprint.hpp 38 CFAFILES = cfa-bench.c bench.h cfa-stack.h cfa-print.h cfa-stack.c cfa-print.c38 CFAFILES = cfa-bench.c bench.h $(CFAOBJS:.o=.h) $(CFAOBJS:.o=.c) 39 39 40 40 c-bench: c-bench.c c-bench.d $(COBJS) -
doc/generic_types/evaluation/bench.h
r33e22da rc87cd93 13 13 printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \ 14 14 } 15 #define REPEAT_N_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } ) 16 #define REPEAT_TIMED(name, code) REPEAT_N_TIMED(name, N, code) 15 #define REPEAT_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } ) -
doc/generic_types/evaluation/bench.hpp
r33e22da rc87cd93 15 15 << std::setw(0) << " ms" << std::endl; \ 16 16 } 17 #define REPEAT_N_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } ) 18 #define REPEAT_TIMED(name, code) REPEAT_N_TIMED(name, N, code) 17 #define REPEAT_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } ) -
doc/generic_types/evaluation/c-bench.c
r33e22da rc87cd93 34 34 } 35 35 36 int cmp_char( const void* a, const void* b ) { 37 return *(const char*)a == *(const char*)b ? 0 : *(const char*)a < *(const char*)b ? -1 : 1; /***/36 int cmp_char( const void* a, const void* b ) { /***/ 37 return *(const char*)a == *(const char*)b ? 0 : *(const char*)a < *(const char*)b ? -1 : 1; 38 38 } 39 39 40 40 int main(int argc, char** argv) { 41 FILE* out = fopen("c-out.txt", "w"); 42 int max = 0; 43 struct stack s = new_stack(), t; 44 REPEAT_TIMED( "push_int", push_stack(&s, new_int( _i )); ) 45 TIMED( "copy_int", copy_stack(&t, &s, copy_int); /***/ ) 46 TIMED( "clear_int", clear_stack(&s, free); /***/ ) 47 REPEAT_TIMED( "pop_int", 48 int* x = pop_stack(&t); /***/ 49 if ( *x > max ) { max = *x; } 50 free(x); ) 51 REPEAT_N_TIMED( "print_int", N/2, print( out, "dsds", _i, ":", _i, "\n" ); /***/ ) 41 FILE * out = fopen("c-out.txt", "w"); 42 int maxi = 0, vali = 42; 43 struct stack si = new_stack(), ti; 52 44 53 struct pair* max2 = new_pair( new_bool(0), new_char('\0') ); 54 struct stack s2 = new_stack(), t2; 45 REPEAT_TIMED( "push_int", N, push_stack( &si, new_int( vali ) ); ) 46 TIMED( "copy_int", copy_stack( &ti, &si, copy_int ); /***/ ) 47 TIMED( "clear_int", clear_stack( &si, free ); /***/ ) 48 REPEAT_TIMED( "pop_int", N, 49 int* xi = pop_stack( &ti ); 50 if ( *xi > maxi ) { maxi = *xi; } 51 free(xi); ) 52 REPEAT_TIMED( "print_int", N/2, print( out, "dsds", vali, ":", vali, "\n" ); /***/ ) 55 53 56 REPEAT_TIMED( "push_bool_char", 57 push_stack(&s2, new_pair( new_bool( _i & 0x1 ), new_char( _i & 0x7F ) )); ) 58 TIMED( "copy_bool_char", copy_stack(&t2, &s2, copy_pair_bool_char); /***/ ) 59 TIMED( "clear_bool_char", clear_stack(&s2, free_pair_bool_char); /***/ ) 60 REPEAT_TIMED( "pop_bool_char", 61 struct pair* x = pop_stack(&t2); /***/ 62 if ( cmp_pair( x, max2, cmp_bool, cmp_char ) > 0 ) { /***/ 63 free_pair_bool_char( max2 ); /***/ 64 max2 = x; 54 struct pair * maxp = new_pair( new_bool(0), new_char('\0') ), 55 * valp = new_pair( new_bool(1), new_char('a') ); 56 struct stack sp = new_stack(), tp; 57 58 REPEAT_TIMED( "push_pair", N, push_stack( &sp, copy_pair_bool_char( valp ) ); ) 59 TIMED( "copy_pair", copy_stack( &tp, &sp, copy_pair_bool_char ); /***/ ) 60 TIMED( "clear_pair", clear_stack( &sp, free_pair_bool_char ); /***/ ) 61 REPEAT_TIMED( "pop_pair", N, 62 struct pair * xp = pop_stack( &tp ); 63 if ( cmp_pair( xp, maxp, cmp_bool, cmp_char /***/ ) > 0 ) { 64 free_pair_bool_char( maxp ); /***/ 65 maxp = xp; 65 66 } else { 66 free_pair_bool_char( x ); /***/67 free_pair_bool_char( xp ); /***/ 67 68 } ) 68 REPEAT_N_TIMED( "print_pair", N/2, 69 struct pair p1 = ((struct pair){ new_bool(rand() & 0x1), new_char(rand() & 0x7F) }); /***/ 70 struct pair p2 = ((struct pair){ new_bool(rand() & 0x1), new_char(rand() & 0x7F) }); /***/ 71 print( out, "pbcspbcs", p1, ":", p2, "\n" ); /***/ 72 free(p1.first); free(p1.second); /***/ 73 free(p2.first); free(p2.second); /***/ ) 74 free_pair_bool_char( max2 ); /***/ 69 REPEAT_TIMED( "print_pair", N/2, print( out, "pbcspbcs", *valp, ":", *valp, "\n" ); /***/ ) 70 free_pair_bool_char( maxp ); /***/ 71 free_pair_bool_char( valp ); /***/ 75 72 fclose(out); 76 73 } -
doc/generic_types/evaluation/cfa-bench.c
r33e22da rc87cd93 1 1 #include <stdlib> 2 2 #include <stdio.h> 3 #include "pair"4 3 #include "bench.h" 5 4 #include "cfa-stack.h" 5 #include "cfa-pair.h" 6 6 #include "cfa-print.h" 7 7 8 8 int main( int argc, char *argv[] ) { 9 9 FILE * out = fopen( "cfa-out.txt", "w" ); 10 int max = 0;11 stack(int) s , t;10 int maxi = 0, vali = 42; 11 stack(int) si, ti; 12 12 13 REPEAT_TIMED( "push_int", push( &s, _i ); )14 TIMED( "copy_int", t = s; )15 TIMED( "clear_int", clear( &s ); )16 REPEAT_TIMED( "pop_int", 17 int x = pop(&t);18 if ( x > max ) { max = x; } )19 REPEAT_TIMED( "print_int", print( out, _i, ":", _i, "\n" ); )13 REPEAT_TIMED( "push_int", N, push( &si, vali ); ) 14 TIMED( "copy_int", ti = si; ) 15 TIMED( "clear_int", clear( &si ); ) 16 REPEAT_TIMED( "pop_int", N, 17 int xi = pop( &ti ); 18 if ( xi > maxi ) { maxi = xi; } ) 19 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); ) 20 20 21 stack(pair(_Bool, char)) s1, t1;22 pair(_Bool, char) max = { (_Bool)0, '\0' };21 pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' }; 22 stack(pair(_Bool, char)) sp, tp; 23 23 24 REPEAT_TIMED( "push_pair", push( &s1, (pair(_Bool, char)){ _i & 1, _i &0x7F } ); ) 25 TIMED( "copy_pair", t1 = s1; ) 26 TIMED( "clear_pair", clear( &s1 ); ) 27 REPEAT_TIMED( "pop_pair", 28 pair(_Bool, char) x = pop(&t1); 29 if ( x > max ) { max = x; } ) 30 REPEAT_TIMED( "print_pair", 31 print( out, (pair(_Bool, char)){ _i & 1, _i &0x7F }, ":", 32 (pair(_Bool, char)){ _i & 1, _i &0x7F }, "\n" ); ) 24 REPEAT_TIMED( "push_pair", N, push( &sp, valp ); ) 25 TIMED( "copy_pair", tp = sp; ) 26 TIMED( "clear_pair", clear( &sp ); ) 27 REPEAT_TIMED( "pop_pair", N, 28 pair(_Bool, char) xp = pop( &tp ); 29 if ( xp > maxp ) { maxp = xp; } ) 30 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); ) 33 31 fclose(out); 34 32 } -
doc/generic_types/evaluation/cfa-pair.c
r33e22da rc87cd93 1 #include " pair"1 #include "cfa-pair.h" 2 2 3 3 forall(otype R, otype S -
doc/generic_types/evaluation/cfa-print.c
r33e22da rc87cd93 1 1 #include <stdio.h> 2 #include " pair"2 #include "cfa-pair.h" 3 3 #include "cfa-print.h" 4 4 -
doc/generic_types/evaluation/cfa-print.h
r33e22da rc87cd93 1 1 #pragma once 2 2 #include <stdio.h> 3 #include " pair"3 #include "cfa-pair.h" 4 4 5 5 forall(otype T, ttype Params | { void print(FILE*, T); void print(FILE*, Params); }) -
doc/generic_types/evaluation/cpp-bench.cpp
r33e22da rc87cd93 1 1 #include <algorithm> 2 2 #include <fstream> 3 #include <utility>4 3 #include "bench.hpp" 5 4 #include "cpp-stack.hpp" 5 #include "cpp-pair.hpp" 6 6 #include "cpp-print.hpp" 7 7 8 8 int main(int argc, char** argv) { 9 9 std::ofstream out{"cpp-out.txt"}; 10 int max = 0;11 stack<int> s , t;10 int maxi = 0, vali = 42; 11 stack<int> si, ti; 12 12 13 REPEAT_TIMED( "push_int", s.push( int{_i} ); ) 14 TIMED( "copy_int", t = s; ) 15 TIMED( "clear_int", s.clear(); ) 16 REPEAT_TIMED( "pop_int", max = std::max( max, t.pop() ); ) 17 print( out, max, "\n" ); 18 REPEAT_N_TIMED( "print_int", N/2, print( out, _i, ":", _i, "\n" ); ) 13 REPEAT_TIMED( "push_int", N, si.push( vali ); ) 14 TIMED( "copy_int", ti = si; ) 15 TIMED( "clear_int", si.clear(); ) 16 REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop() ); ) 17 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); ) 19 18 20 std::pair<bool, char> max1 = { false, '\0' };21 stack< std::pair<bool, char>> s1, t1;19 pair<bool, char> maxp = { false, '\0' }, valp = { true, 'a' }; 20 stack<pair<bool, char>> sp, tp; 22 21 23 REPEAT_TIMED( "push_bool_char", s1.push( std::pair<bool, char>{ _i & 0x1, _i & 0x7F } ); ) 24 TIMED( "copy_bool_char", t1 = s1; ) 25 TIMED( "clear_bool_char", s1.clear(); ) 26 REPEAT_TIMED( "pop_bool_char", max1 = std::max( max1, t1.pop() ); ) 27 print( out, max1, "\n" ); 28 REPEAT_N_TIMED( "print_pair", N/2, 29 print( out, std::pair<bool, char>{ _i & 0x1, _i & 0x7F }, ":", 30 std::pair<bool, char>{ _i & 0x1, _i & 0x7F }, "\n" ); ) 22 REPEAT_TIMED( "push_pair", N, sp.push( valp ); ) 23 TIMED( "copy_pair", tp = sp; ) 24 TIMED( "clear_pair", sp.clear(); ) 25 REPEAT_TIMED( "pop_pair", N, maxp = std::max( maxp, tp.pop() ); ) 26 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); ) 31 27 } -
doc/generic_types/evaluation/cpp-print.hpp
r33e22da rc87cd93 2 2 #include <iomanip> 3 3 #include <iostream> 4 #include <utility>4 #include "cpp-pair.hpp" 5 5 6 6 template<typename T> void print(std::ostream& out, const T& x) { out << x; } … … 14 14 15 15 template<typename R, typename S> 16 std::ostream& operator<< (std::ostream& out, const std::pair<R, S>& x) {16 std::ostream& operator<< (std::ostream& out, const pair<R, S>& x) { 17 17 out << "["; 18 18 print(out, x.first); -
doc/generic_types/evaluation/cpp-stack.hpp
r33e22da rc87cd93 7 7 node* next; 8 8 9 node( T& v ) : value(v), next(nullptr) {} 10 node( T&& v, node* n ) : value(std::move(v)), next(n) {} 9 node( const T& v, node* n = nullptr ) : value(v), next(n) {} 11 10 }; 12 11 node* head; … … 54 53 bool empty() const { return head == nullptr; } 55 54 56 void push( T&& value) { head = new node{ std::move(value), head }; /***/ }55 void push(const T& value) { head = new node{ value, head }; /***/ } 57 56 58 57 T pop() { -
doc/generic_types/evaluation/cpp-vbench.cpp
r33e22da rc87cd93 8 8 int main(int argc, char** argv) { 9 9 std::ofstream out{"cpp-vout.txt"}; 10 integer max { 0};11 stack s , t;10 integer maxi{ 0 }, vali{ 42 }; 11 stack si, ti; 12 12 13 REPEAT_TIMED( "push_int", s.push( make<integer>( _i ) ); ) 14 TIMED( "copy_int", t = s; ) 15 TIMED( "clear_int", s.clear(); ) 16 REPEAT_TIMED( "pop_int", max = std::max( max, t.pop()->as<integer>() ); /***/ ) 17 print( out, max, c_string{"\n"} ); 18 REPEAT_N_TIMED( "print_int", N/2, 19 print( out, integer{_i}, c_string{":"}, integer{_i}, c_string{"\n"} ); ) 13 REPEAT_TIMED( "push_int", N, si.push( vali ); ) 14 TIMED( "copy_int", ti = si; ) 15 TIMED( "clear_int", si.clear(); ) 16 REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop()->as<integer>() ); /***/ ) 17 REPEAT_TIMED( "print_int", N/2, print( out, vali, c_string{":"}, vali, c_string{"\n"} ); ) 20 18 21 ptr<pair> max1 = make<pair>( make<boolean>(false), make<character>('\0') ); 22 stack s1, t1; 19 ptr<pair> maxp = make<pair>( make<boolean>(false), make<character>('\0') ); 20 pair valp{ make<boolean>(true), make<character>('a') }; 21 stack sp, tp; 23 22 24 REPEAT_TIMED( "push_bool_char", 25 s1.push( make<pair>( make<boolean>(_i & 1), make<character>(_i & 0x7F) ) ); ) 26 TIMED( "copy_bool_char", t1 = s1; ) 27 TIMED( "clear_bool_char", s1.clear(); ) 28 REPEAT_TIMED( "pop_bool_char", 29 ptr<pair> x = as_ptr<pair>( t1.pop() ); /***/ 30 if ( *x > *max1 ) { max1 = std::move(x); } ) 31 print( out, *max1, c_string{"\n"} ); 32 REPEAT_N_TIMED( "print_pair", N/2, 33 print( out, pair{ make<boolean>(_i & 1), make<character>(_i & 0x7F) }, c_string{":"}, 34 pair{ make<boolean>(_i & 1), make<character>(_i & 0x7F) }, c_string{"\n"} ); ) 23 REPEAT_TIMED( "push_pair", N, sp.push( valp ); ) 24 TIMED( "copy_pair", tp = sp; ) 25 TIMED( "clear_pair", sp.clear(); ) 26 REPEAT_TIMED( "pop_pair", N, 27 ptr<pair> xp = as_ptr<pair>( tp.pop() ); /***/ 28 if ( *xp > *maxp ) { maxp = std::move(xp); } ) 29 REPEAT_TIMED( "print_pair", N/2, print( out, valp, c_string{":"}, valp, c_string{"\n"} ); ) 35 30 } -
doc/generic_types/evaluation/cpp-vstack.cpp
r33e22da rc87cd93 2 2 #include <utility> 3 3 4 stack::node::node( const object& v ) : value( v.new_copy() ), next( nullptr ) {} 5 stack::node::node( ptr<object>&& v, node* n ) : value( std::move(v) ), next( n ) {} 4 stack::node::node( const object& v, node* n ) : value( v.new_copy() ), next( n ) {} 6 5 7 6 void stack::copy(const stack& o) { … … 48 47 bool stack::empty() const { return head == nullptr; } 49 48 50 void stack::push( ptr<object>&& value) { head = new node{ std::move(value), head }; /***/ }49 void stack::push(const object& value) { head = new node{ value, head }; /***/ } 51 50 52 51 ptr<object> stack::pop() { -
doc/generic_types/evaluation/cpp-vstack.hpp
r33e22da rc87cd93 7 7 node* next; 8 8 9 node( const object& v ); 10 node( ptr<object>&& v, node* n ); 9 node( const object& v, node* n = nullptr ); 11 10 }; 12 11 node* head; … … 23 22 void clear(); 24 23 bool empty() const; 25 void push( ptr<object>&& value);24 void push(const object& value); 26 25 ptr<object> pop(); 27 26 }; -
doc/generic_types/evaluation/object.hpp
r33e22da rc87cd93 72 72 boolean() = default; 73 73 boolean(bool x) : x(x) {} 74 boolean(const boolean&) = default; 75 boolean(boolean&&) = default; 74 76 ptr<object> new_inst() const override { return make<boolean>(); } 75 77 ptr<object> new_copy() const override { return make<boolean>(*this); } … … 79 81 } 80 82 object& operator= (const object& that) override { return *this = that.as<boolean>(); } /***/ 83 boolean& operator= (boolean&&) = default; 81 84 ~boolean() override = default; 82 85 … … 92 95 character() = default; 93 96 character(char x) : x(x) {} 97 character(const character&) = default; 98 character(character&&) = default; 94 99 ptr<object> new_inst() const override { return make<character>(); } 95 100 ptr<object> new_copy() const override { return make<character>(*this); } … … 99 104 } 100 105 object& operator= (const object& that) override { return *this = that.as<character>(); } /***/ 106 character& operator= (character&&) = default; 101 107 ~character() override = default; 102 108 … … 115 121 integer() = default; 116 122 integer(int x) : x(x) {} 123 integer(const integer&) = default; 124 integer(integer&&) = default; 117 125 ptr<object> new_inst() const override { return make<integer>(); } 118 126 ptr<object> new_copy() const override { return make<integer>(*this); } … … 122 130 } 123 131 object& operator= (const object& that) override { return *this = that.as<integer>(); } /***/ 132 integer& operator= (integer&&) = default; 124 133 ~integer() override = default; 125 134 … … 136 145 c_string() : s(empty) {} 137 146 c_string(const char* s) : s(s) {} 147 c_string(const c_string&) = default; 148 c_string(c_string&&) = default; 138 149 ptr<object> new_inst() const override { return make<c_string>(); } 139 150 ptr<object> new_copy() const override { return make<c_string>(s); } … … 143 154 } 144 155 object& operator= (const object& that) override { return *this = that.as<c_string>(); } /***/ 156 c_string& operator= (c_string&&) = default; 145 157 ~c_string() override = default; 146 158 … … 154 166 pair() = default; 155 167 pair(ptr<object>&& x, ptr<object>&& y) : x(std::move(x)), y(std::move(y)) {} 168 pair(const pair& that) : x(that.x->new_copy()), y(that.y->new_copy()) {} 169 pair(pair&& that) : x(std::move(that.x)), y(std::move(that.y)) {} 156 170 ptr<object> new_inst() const override { return make<pair>(); } 157 171 ptr<object> new_copy() const override { return make<pair>(x->new_copy(), y->new_copy()); } … … 162 176 } 163 177 object& operator= (const object& that) override { return *this = that.as<pair>(); } /***/ 178 pair& operator= (pair&& that) { 179 x = std::move(that.x); 180 y = std::move(that.y); 181 return *this; 182 } 164 183 ~pair() override = default; 165 184 -
doc/generic_types/evaluation/timing.dat
r33e22da rc87cd93 1 1 "400 million repetitions" "C" "\\CFA{}" "\\CC{}" "\\CC{obj}" 2 "push\nint" 3324 2263 1583 3141 3 "copy\nint" 2999 2055 1560 3136 4 "clear\nint" 1384 816 754 1498 5 "pop\nint" 1413 1172 751 5344 6 "print\nint" 7106 12458 3976 4044 7 "push\npair" 4916 3139 1014 6407 8 "copy\npair" 6218 2077 1002 7067 9 "clear\npair" 2777 886 722 3519 10 "pop\npair" 2857 4200 784 21145 11 "print\npair" 13536 21726 9009 20516 12 2 "push\nint" 2958 2480 1519 3284 3 "copy\nint" 2961 2014 1534 3126 4 "clear\nint" 1350 817 722 1459 5 "pop\nint" 1386 1174 717 5404 6 "print\nint" 5702 6615 3077 3191 7 "push\npair" 4160 2648 940 6566 8 "copy\npair" 6195 2099 977 7234 9 "clear\npair" 2834 863 723 3315 10 "pop\npair" 2956 5591 775 26256 11 "print\npair" 7498 10804 8750 16638 -
doc/generic_types/generic_types.tex
r33e22da rc87cd93 964 964 \begin{figure} 965 965 \begin{lstlisting}[xleftmargin=3\parindentlnth,aboveskip=0pt,belowskip=0pt] 966 int main( int argc, char * 966 int main( int argc, char *argv[] ) { 967 967 FILE * out = fopen( "cfa-out.txt", "w" ); 968 int max = 0, vali = 42;968 int maxi = 0, vali = 42; 969 969 stack(int) si, ti; 970 970 971 REPEAT_TIMED( "push_int", push( &si, vali ); )971 REPEAT_TIMED( "push_int", N, push( &si, vali ); ) 972 972 TIMED( "copy_int", ti = si; ) 973 973 TIMED( "clear_int", clear( &si ); ) 974 REPEAT_TIMED( "pop_int", max = max( max, pop( &ti ) ); ) 975 REPEAT_TIMED( "print_int", print( out, vali, ":", vali, "\n" ); ) 976 977 pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)0, 'a' }; 974 REPEAT_TIMED( "pop_int", N, 975 int xi = pop( &ti ); 976 if ( xi > maxi ) { maxi = xi; } ) 977 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); ) 978 979 pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' }; 978 980 stack(pair(_Bool, char)) sp, tp; 979 981 980 REPEAT_TIMED( "push_pair", push( &sp, valp ); )982 REPEAT_TIMED( "push_pair", N, push( &sp, valp ); ) 981 983 TIMED( "copy_pair", tp = sp; ) 982 984 TIMED( "clear_pair", clear( &sp ); ) 983 REPEAT_TIMED( "pop_pair", maxp = max( maxp, pop( &tp ) ); ) 984 REPEAT_TIMED( "print_pair", print( out, valp, ":", valp, "\n" ); ) 985 REPEAT_TIMED( "pop_pair", N, 986 pair(_Bool, char) xp = pop( &tp ); 987 if ( xp > maxp ) { maxp = xp; } ) 988 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); ) 985 989 fclose(out); 986 990 } … … 1008 1012 \begin{tabular}{rrrrr} 1009 1013 & \CT{C} & \CT{\CFA} & \CT{\CC} & \CT{\CCV} \\ \hline 1010 maximum memory usage (MB) & 10001 & 250 1& 2503 & 11253 \\1011 source code size (lines) & 301 & 224 & 188 & 437\\1012 redundant type annotations (lines) & 46 & 3& 2 & 15 \\1013 binary size (KB) & 1 8 & 234 & 18 & 42\\1014 maximum memory usage (MB) & 10001 & 2502 & 2503 & 11253 \\ 1015 source code size (lines) & 247 & 223 & 165 & 339 \\ 1016 redundant type annotations (lines) & 39 & 2 & 2 & 15 \\ 1017 binary size (KB) & 14 & 229 & 18 & 38 \\ 1014 1018 \end{tabular} 1015 1019 \end{table}
Note: See TracChangeset
for help on using the changeset viewer.