Changes in / [3d8f2f8:8b001bd]
- Location:
- doc/papers/general
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
r3d8f2f8 r8b001bd 2637 2637 & \CT{C} & \CT{\CFA} & \CT{\CC} & \CT{\CCV} \\ \hline 2638 2638 maximum memory usage (MB) & 10,001 & 2,502 & 2,503 & 11,253 \\ 2639 source code size (lines) & 197 & 186 & 1 25 & 293 \\2639 source code size (lines) & 197 & 186 & 133 & 303 \\ 2640 2640 redundant type annotations (lines) & 27 & 0 & 2 & 16 \\ 2641 2641 binary size (KB) & 14 & 257 & 14 & 37 \\ … … 2906 2906 } 2907 2907 \end{cfa} 2908 2909 \begin{comment}2910 forall( otype T ) {2911 struct stack_node {2912 T value;2913 stack_node(T) * next;2914 };2915 struct stack { stack_node(T) * head; };2916 void clear( stack(T) & s ) with( s ) {2917 for ( stack_node(T) * next = head; next; ) {2918 stack_node(T) * crnt = next;2919 next = crnt->next;2920 ^(*crnt){};2921 free(crnt);2922 }2923 head = 0;2924 }2925 void ?{}( stack(T) & s ) { (s.head){ 0 }; }2926 void ?{}( stack(T) & s, stack(T) t ) {2927 stack_node(T) ** crnt = &s.head;2928 for ( stack_node(T) * next = t.head; next; next = next->next ) {2929 *crnt = alloc();2930 ((*crnt)->value){ next->value };2931 crnt = &(*crnt)->next;2932 }2933 *crnt = 0;2934 }2935 stack(T) ?=?( stack(T) & s, stack(T) t ) {2936 if ( s.head == t.head ) return s;2937 clear( s );2938 s{ t };2939 return s;2940 }2941 void ^?{}( stack(T) & s) { clear( s ); }2942 _Bool empty( const stack(T) & s ) { return s.head == 0; }2943 void push( stack(T) & s, T value ) with( s ) {2944 stack_node(T) * n = alloc();2945 (*n){ value, head };2946 head = n;2947 }2948 T pop( stack(T) & s ) with( s ) {2949 stack_node(T) * n = head;2950 head = n->next;2951 T v = n->value;2952 ^(*n){};2953 free( n );2954 return v;2955 }2956 }2957 \end{comment}2958 2908 2959 2909 \medskip\noindent … … 2993 2943 return *this; 2994 2944 } 2945 stack & operator= ( stack<T> && o ) { 2946 if ( this == &o ) return *this; 2947 head = o.head; 2948 o.head = nullptr; 2949 return *this; 2950 } 2995 2951 bool empty() const { return head == nullptr; } 2996 2952 void push( const T & value ) { head = new node{ value, head }; /***/ } … … 3033 2989 stack() : head( nullptr ) {} 3034 2990 stack( const stack & o ) { copy( o ); } 2991 stack( stack && o ) : head( o.head ) { o.head = nullptr; } 3035 2992 ~stack() { clear(); } 3036 stack & operator= 2993 stack & operator=( const stack & o ) { 3037 2994 if ( this == &o ) return *this; 3038 2995 clear(); 3039 2996 copy( o ); 2997 return *this; 2998 } 2999 stack & operator=( stack && o ) { 3000 if ( this == &o ) return *this; 3001 head = o.head; 3002 o.head = nullptr; 3040 3003 return *this; 3041 3004 } -
doc/papers/general/evaluation/cpp-stack.hpp
r3d8f2f8 r8b001bd 11 11 12 12 stack() : head( nullptr ) {} 13 stack( const stack<T> & o 13 stack( const stack<T> & o) { copy( o ); } 14 14 stack( stack<T> && o ) : head( o.head ) { o.head = nullptr; } 15 15 … … 41 41 } 42 42 43 stack & operator= ( stack<T> && o ) { 44 if ( this == &o ) return *this; 45 head = o.head; 46 o.head = nullptr; 47 return *this; 48 } 49 43 50 bool empty() const { return head == nullptr; } 44 51 -
doc/papers/general/evaluation/cpp-vstack.hpp
r3d8f2f8 r8b001bd 17 17 stack( stack && o ); 18 18 ~stack(); 19 stack & operator=( const stack& o ); 20 stack & operator=( stack && o ); 19 stack& operator=( const stack& o ); 20 stack& operator=( stack && o ); 21 21 22 bool empty() const; 22 23 void push( const object & value ); -
doc/papers/general/evaluation/timing.dat
r3d8f2f8 r8b001bd 1 1 "400 million repetitions" "C" "\\CFA{}" "\\CC{}" "\\CC{obj}" 2 "push\nint" 3002 2459 15 42 32693 "copy\nint" 2985 2057 15 39 30834 "clear\nint" 1374 827 7 5614695 "pop\nint" 1416 1221 7 60 50986 "push\npair" 4214 2752 9 50 68737 "copy\npair" 6127 2105 9 87 72938 "clear\npair" 2881 885 7 51 34609 "pop\npair" 3046 5434 822 249622 "push\nint" 3002 2459 1520 3305 3 "copy\nint" 2985 2057 1521 3152 4 "clear\nint" 1374 827 718 1469 5 "pop\nint" 1416 1221 717 5467 6 "push\npair" 4214 2752 946 6826 7 "copy\npair" 6127 2105 993 7330 8 "clear\npair" 2881 885 711 3564 9 "pop\npair" 3046 5434 783 26538 -
doc/papers/general/evaluation/timing.gp
r3d8f2f8 r8b001bd 24 24 set yrange [0:10] 25 25 26 set label "2 5.0" at 7.125,10.526 set label "26.5" at 7.125,10.5 27 27 28 28 # set datafile separator ","
Note: See TracChangeset
for help on using the changeset viewer.