Changes in / [1518b39:b9c432f]
- Files:
-
- 12 edited
-
doc/papers/general/Paper.tex (modified) (8 diffs)
-
doc/papers/general/evaluation/c-stack.c (modified) (2 diffs)
-
doc/papers/general/evaluation/c-stack.h (modified) (1 diff)
-
doc/papers/general/evaluation/cfa-stack.c (modified) (3 diffs)
-
doc/papers/general/evaluation/cfa-stack.h (modified) (1 diff)
-
doc/papers/general/evaluation/cpp-stack.hpp (modified) (3 diffs)
-
doc/papers/general/evaluation/cpp-vstack.cpp (modified) (3 diffs)
-
doc/papers/general/evaluation/cpp-vstack.hpp (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (1 diff)
-
src/benchmark/bench.h (modified) (2 diffs)
-
src/benchmark/ctxswitch/cfa_cor.c (modified) (1 diff)
-
src/libcfa/concurrency/thread (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
r1518b39 rb9c432f 2875 2875 } 2876 2876 _Bool stack_empty( const stack * s ) { 2877 return s->head == NULL;2877 return s->head == NULL; 2878 2878 } 2879 2879 void push_stack( stack * s, void * v ) { 2880 node * n = malloc( sizeof(node)); /***/2880 node * n = malloc(sizeof(node)); /***/ 2881 2881 *n = (node){ v, s->head }; /***/ 2882 2882 s->head = n; … … 2908 2908 }; 2909 2909 struct stack { node(T) * head; }; 2910 void ?{}( stack(T) & s, stack(T) t ) { // copy 2910 void ?{}( stack(T) & s ) { (s.head){ 0 }; } 2911 void ?{}( stack(T) & s, stack(T) t ) { 2911 2912 node(T) ** cr = &s.head; 2912 2913 for ( node(T) * nx = t.head; nx; nx = nx->next ) { … … 2922 2923 nx = cr->next; 2923 2924 ^(*cr){}; 2924 free( cr);2925 free(cr); 2925 2926 } 2926 2927 head = 0; 2927 2928 } 2928 2929 2929 \end{cfa} 2930 2930 & 2931 2931 \begin{cfa}[xleftmargin=0pt,aboveskip=0pt,belowskip=0pt] 2932 void ?{}( stack(T) & s ) { (s.head){ 0 }; }2933 2932 void ^?{}( stack(T) & s) { clear( s ); } 2934 2933 stack(T) ?=?( stack(T) & s, stack(T) t ) { … … 2955 2954 } 2956 2955 } 2956 2957 2957 \end{cfa} 2958 2958 \end{tabular} … … 3003 3003 return *this; 3004 3004 } 3005 bool empty() const { 3006 return head == nullptr; 3007 } 3005 bool empty() const { return head == nullptr; } 3008 3006 void push( const T & value ) { 3009 3007 head = new node{ value, head }; /***/ … … 3017 3015 } 3018 3016 }; 3017 3018 3019 3019 3020 3020 \end{cfa} … … 3066 3066 return *this; 3067 3067 } 3068 bool empty() const { 3069 return head == nullptr; 3070 } 3068 bool empty() const { return head == nullptr; } 3071 3069 void push( const object & value ) { 3072 3070 head = new node{ value, head }; /***/ … … 3081 3079 }; 3082 3080 3081 3082 3083 3083 \end{cfa} 3084 3084 \end{tabular} -
doc/papers/general/evaluation/c-stack.c
r1518b39 rb9c432f 27 27 } 28 28 29 stack new_stack() { 30 return (stack){ NULL }; /***/ 31 } 29 stack new_stack() { return (stack){ NULL }; /***/ } 32 30 33 31 stack * assign_stack( stack * s, const stack * t, … … 39 37 } 40 38 41 _Bool stack_empty( const stack * s ) { 42 return s->head == NULL; 43 } 39 _Bool stack_empty( const stack * s ) { return s->head == NULL; } 44 40 45 41 void push_stack( stack * s, void * v ) { -
doc/papers/general/evaluation/c-stack.h
r1518b39 rb9c432f 6 6 } stack; 7 7 8 stack new_stack(); 8 9 void copy_stack(stack * dst, const stack * src, void * (* copy)(const void *)); 9 void clear_stack(stack * s, void (*free_el)(void *));10 stack new_stack();11 10 stack * assign_stack( stack * dst, const stack * src, 12 11 void * (* copy_el)(const void *), void (* free_el)(void *)); 12 void clear_stack(stack * s, void (*free_el)(void *)); 13 13 14 14 _Bool stack_empty( const stack * s ); -
doc/papers/general/evaluation/cfa-stack.c
r1518b39 rb9c432f 8 8 }; 9 9 10 void ?{}( stack(T) & s, stack(T) t ) { // copy 10 void ?{}( stack(T) & s ) { (s.head){ 0 }; } 11 12 void ?{}( stack(T) & s, stack(T) t ) { 11 13 node(T) ** cr = &s.head; 12 14 for ( node(T) * nx = t.head; nx; nx = nx->next ) { … … 18 20 } 19 21 20 void clear( stack(T) & s ) with( s ) { 22 void ^?{}( stack(T) & s) { clear( s ); } 23 24 void clear( stack(T) & s ) with( s ) { 21 25 for ( node(T) * nx = head; nx; ) { 22 26 node(T) * cr = nx; 23 27 nx = cr->next; 24 28 ^(*cr){}; 25 free( cr);29 free(cr); 26 30 } 27 31 head = 0; 28 32 } 29 30 void ?{}( stack(T) & s ) { (s.head){ 0 }; }31 void ^?{}( stack(T) & s) { clear( s ); }32 33 33 34 stack(T) ?=?( stack(T) & s, stack(T) t ) { … … 38 39 } 39 40 40 _Bool empty( const stack(T) & s ) { 41 return s.head == 0; 42 } 41 _Bool empty( const stack(T) & s ) { return s.head == 0; } 43 42 44 43 void push( stack(T) & s, T value ) with( s ) { -
doc/papers/general/evaluation/cfa-stack.h
r1518b39 rb9c432f 7 7 }; 8 8 9 void ?{}( stack(T) & s ); 9 10 void ?{}( stack(T) & s, stack(T) t ); 11 void ^?{}( stack(T) & s); 10 12 void clear( stack(T) & s ); 11 void ?{}( stack(T) & s );12 void ^?{}( stack(T) & s);13 13 14 14 stack(T) ?=?( stack(T) & s, stack(T) t ); -
doc/papers/general/evaluation/cpp-stack.hpp
r1518b39 rb9c432f 10 10 node * head; 11 11 12 void copy( const stack<T> & o ) { 13 node ** cr = &head; 14 for ( node * nx = o.head; nx; nx = nx->next ) { 15 *cr = new node{ nx->value }; /***/ 16 cr = &(*cr)->next; 17 } 18 *cr = nullptr; 19 } 12 stack() : head( nullptr ) {} 13 stack( const stack<T> & o ) { copy( o ); } 20 14 21 15 void clear() { … … 28 22 } 29 23 30 stack() : head( nullptr ) {} 31 stack( const stack<T> & o ) { copy( o ); } 24 void copy( const stack<T> & o ) { 25 node ** cr = &head; 26 for ( node * nx = o.head; nx; nx = nx->next ) { 27 *cr = new node{ nx->value }; /***/ 28 cr = &(*cr)->next; 29 } 30 *cr = nullptr; 31 } 32 32 33 ~stack() { clear(); } 33 34 34 stack & operator= ( const stack<T> & o ) {35 stack & operator= ( const stack<T> & o ) { 35 36 if ( this == &o ) return *this; 36 37 clear(); … … 39 40 } 40 41 41 bool empty() const { 42 return head == nullptr; 43 } 42 bool empty() const { return head == nullptr; } 44 43 45 void push( const T & value ) { 46 head = new node{ value, head }; /***/ 47 } 44 void push( const T & value ) { head = new node{ value, head }; /***/ } 48 45 49 46 T pop() { -
doc/papers/general/evaluation/cpp-vstack.cpp
r1518b39 rb9c432f 3 3 4 4 stack::node::node( const object & v, node * n ) : value( v.new_copy() ), next( n ) {} 5 6 void stack::clear() { 7 for ( node * nx = head; nx; ) { 8 node * cr = nx; 9 nx = cr->next; 10 delete cr; 11 } 12 head = nullptr; 13 } 5 14 6 15 void stack::copy( const stack & o ) { … … 11 20 } 12 21 *cr = nullptr; 13 }14 15 void stack::clear() {16 for ( node * nx = head; nx; ) {17 node * cr = nx;18 nx = cr->next;19 delete cr;20 }21 head = nullptr;22 22 } 23 23 … … 33 33 } 34 34 35 bool stack::empty() const { 36 return head == nullptr; 37 } 35 bool stack::empty() const { return head == nullptr; } 38 36 39 void stack::push( const object & value ) { 40 head = new node{ value, head }; /***/ 41 } 37 void stack::push( const object & value ) { head = new node{ value, head }; /***/ } 42 38 43 39 ptr<object> stack::pop() { -
doc/papers/general/evaluation/cpp-vstack.hpp
r1518b39 rb9c432f 10 10 node * head; 11 11 12 void clear(); 12 13 void copy( const stack & o ); 13 void clear();14 14 15 15 stack(); -
src/ResolvExpr/Resolver.cc
r1518b39 rb9c432f 583 583 ss << "' to '"; 584 584 arg.expr->get_result()->print( ss ); 585 ss << "' with env '";586 resultEnv.print(ss);587 585 ss << "'\n"; 588 586 SemanticError( function, ss.str() ); -
src/benchmark/bench.h
r1518b39 rb9c432f 6 6 #include <stdlib.h> 7 7 #include <unistd.h> // sysconf 8 #include <sys/times.h> // times 9 #include <time.h> 8 10 #if defined(__cforall) 9 11 } 10 #include <time>12 //#include <bits/cfatime.h> 11 13 #endif 12 14 13 15 14 static inline unsigned long long int bench_time() {16 static inline unsigned long long int Time() { 15 17 struct timespec ts; 16 18 clock_gettime( … … 39 41 } \ 40 42 long long int StartTime, EndTime; \ 41 StartTime = bench_time(); \43 StartTime = Time(); \ 42 44 statement; \ 43 EndTime = bench_time(); \45 EndTime = Time(); \ 44 46 unsigned long long int output = \ 45 47 ( EndTime - StartTime ) / n; 46 48 47 Durationdefault_preemption() {49 __cfa_time_t default_preemption() { 48 50 return 0; 49 51 } -
src/benchmark/ctxswitch/cfa_cor.c
r1518b39 rb9c432f 1 1 #include <stdio.h> 2 #include <kernel>3 2 #include <thread> 4 3 -
src/libcfa/concurrency/thread
r1518b39 rb9c432f 20 20 21 21 #include "coroutine" 22 #include "kernel"23 22 #include "monitor" 24 23
Note:
See TracChangeset
for help on using the changeset viewer.