Changeset 3d8f2f8
- Timestamp:
- Mar 9, 2018, 1:28:54 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:
- e84382b
- Parents:
- 8b001bd (diff), f86c8e5 (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. - Location:
- doc/papers/general
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
r8b001bd r3d8f2f8 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 33 & 303 \\2639 source code size (lines) & 197 & 186 & 125 & 293 \\ 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} 2908 2958 2909 2959 \medskip\noindent … … 2943 2993 return *this; 2944 2994 } 2945 stack & operator= ( stack<T> && o ) {2946 if ( this == &o ) return *this;2947 head = o.head;2948 o.head = nullptr;2949 return *this;2950 }2951 2995 bool empty() const { return head == nullptr; } 2952 2996 void push( const T & value ) { head = new node{ value, head }; /***/ } … … 2989 3033 stack() : head( nullptr ) {} 2990 3034 stack( const stack & o ) { copy( o ); } 2991 stack( stack && o ) : head( o.head ) { o.head = nullptr; }2992 3035 ~stack() { clear(); } 2993 stack & operator= ( const stack & o ) {3036 stack & operator= ( const stack & o ) { 2994 3037 if ( this == &o ) return *this; 2995 3038 clear(); 2996 3039 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;3003 3040 return *this; 3004 3041 } -
doc/papers/general/evaluation/cpp-stack.hpp
r8b001bd r3d8f2f8 11 11 12 12 stack() : head( nullptr ) {} 13 stack( const stack<T> & o ) { copy( 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 50 43 bool empty() const { return head == nullptr; } 51 44 -
doc/papers/general/evaluation/cpp-vstack.hpp
r8b001bd r3d8f2f8 17 17 stack( stack && o ); 18 18 ~stack(); 19 stack& operator=( const stack& o ); 20 stack& operator=( stack && o ); 21 19 stack & operator=( const stack& o ); 20 stack & operator=( stack && o ); 22 21 bool empty() const; 23 22 void push( const object & value ); -
doc/papers/general/evaluation/timing.dat
r8b001bd r3d8f2f8 1 1 "400 million repetitions" "C" "\\CFA{}" "\\CC{}" "\\CC{obj}" 2 "push\nint" 3002 2459 15 20 33053 "copy\nint" 2985 2057 15 21 31524 "clear\nint" 1374 827 7 1814695 "pop\nint" 1416 1221 7 17 54676 "push\npair" 4214 2752 9 46 68267 "copy\npair" 6127 2105 9 93 73308 "clear\npair" 2881 885 7 11 35649 "pop\npair" 3046 5434 783 265382 "push\nint" 3002 2459 1542 3269 3 "copy\nint" 2985 2057 1539 3083 4 "clear\nint" 1374 827 756 1469 5 "pop\nint" 1416 1221 760 5098 6 "push\npair" 4214 2752 950 6873 7 "copy\npair" 6127 2105 987 7293 8 "clear\npair" 2881 885 751 3460 9 "pop\npair" 3046 5434 822 24962 -
doc/papers/general/evaluation/timing.gp
r8b001bd r3d8f2f8 24 24 set yrange [0:10] 25 25 26 set label "2 6.5" at 7.125,10.526 set label "25.0" at 7.125,10.5 27 27 28 28 # set datafile separator ","
Note: See TracChangeset
for help on using the changeset viewer.