Changes in / [1518b39:b9c432f]


Ignore:
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/Paper.tex

    r1518b39 rb9c432f  
    28752875}
    28762876_Bool stack_empty( const stack * s ) {
    2877         return s->head == NULL;
     2877         return s->head == NULL;
    28782878}
    28792879void push_stack( stack * s, void * v ) {
    2880         node * n = malloc( sizeof(node) ); /***/
     2880        node * n = malloc(sizeof(node)); /***/
    28812881        *n = (node){ v, s->head }; /***/
    28822882        s->head = n;
     
    29082908        };
    29092909        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 ) {
    29112912                node(T) ** cr = &s.head;
    29122913                for ( node(T) * nx = t.head; nx; nx = nx->next ) {
     
    29222923                        nx = cr->next;
    29232924                        ^(*cr){};
    2924                         free( cr );
     2925                        free(cr);
    29252926                }
    29262927                head = 0;
    29272928        }
    2928 
    29292929\end{cfa}
    29302930&
    29312931\begin{cfa}[xleftmargin=0pt,aboveskip=0pt,belowskip=0pt]
    2932         void ?{}( stack(T) & s ) { (s.head){ 0 }; }
    29332932        void ^?{}( stack(T) & s) { clear( s ); }
    29342933        stack(T) ?=?( stack(T) & s, stack(T) t ) {
     
    29552954        }
    29562955}
     2956
    29572957\end{cfa}
    29582958\end{tabular}
     
    30033003                return *this;
    30043004        }
    3005         bool empty() const {
    3006                 return head == nullptr;
    3007         }
     3005        bool empty() const { return head == nullptr; }
    30083006        void push( const T & value ) {
    30093007                head = new node{ value, head };  /***/
     
    30173015        }
    30183016};
     3017
     3018
    30193019
    30203020\end{cfa}
     
    30663066                return *this;
    30673067        }
    3068         bool empty() const {
    3069                 return head == nullptr;
    3070         }
     3068        bool empty() const { return head == nullptr; }
    30713069        void push( const object & value ) {
    30723070                head = new node{ value, head }; /***/
     
    30813079};
    30823080
     3081
     3082
    30833083\end{cfa}
    30843084\end{tabular}
  • doc/papers/general/evaluation/c-stack.c

    r1518b39 rb9c432f  
    2727}
    2828
    29 stack new_stack() {
    30         return (stack){ NULL }; /***/
    31 }
     29stack new_stack() { return (stack){ NULL }; /***/ }
    3230
    3331stack * assign_stack( stack * s, const stack * t,
     
    3937}
    4038
    41 _Bool stack_empty( const stack * s ) {
    42         return s->head == NULL;
    43 }
     39_Bool stack_empty( const stack * s ) { return s->head == NULL; }
    4440
    4541void push_stack( stack * s, void * v ) {
  • doc/papers/general/evaluation/c-stack.h

    r1518b39 rb9c432f  
    66} stack;
    77
     8stack new_stack();
    89void 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();
    1110stack * assign_stack( stack * dst, const stack * src,
    1211        void * (* copy_el)(const void *), void (* free_el)(void *));
     12void clear_stack(stack * s, void (*free_el)(void *));
    1313
    1414_Bool stack_empty( const stack * s );
  • doc/papers/general/evaluation/cfa-stack.c

    r1518b39 rb9c432f  
    88        };
    99
    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 ) {
    1113                node(T) ** cr = &s.head;
    1214                for ( node(T) * nx = t.head; nx; nx = nx->next ) {
     
    1820        }
    1921
    20         void clear( stack(T) & s ) with( s ) {
     22        void ^?{}( stack(T) & s) { clear( s ); }
     23
     24    void clear( stack(T) & s ) with( s ) {
    2125                for ( node(T) * nx = head; nx; ) {
    2226                        node(T) * cr = nx;
    2327                        nx = cr->next;
    2428                        ^(*cr){};
    25                         free( cr );
     29                        free(cr);
    2630                }
    2731                head = 0;
    2832        }
    29 
    30         void ?{}( stack(T) & s ) { (s.head){ 0 }; }
    31         void ^?{}( stack(T) & s) { clear( s ); }
    3233
    3334        stack(T) ?=?( stack(T) & s, stack(T) t ) {
     
    3839        }
    3940
    40         _Bool empty( const stack(T) & s ) {
    41                 return s.head == 0;
    42         }
     41        _Bool empty( const stack(T) & s ) { return s.head == 0; }
    4342
    4443        void push( stack(T) & s, T value ) with( s ) {
  • doc/papers/general/evaluation/cfa-stack.h

    r1518b39 rb9c432f  
    77        };
    88
     9        void ?{}( stack(T) & s );
    910        void ?{}( stack(T) & s, stack(T) t );
     11        void ^?{}( stack(T) & s);
    1012        void clear( stack(T) & s );
    11         void ?{}( stack(T) & s );
    12         void ^?{}( stack(T) & s);
    1313
    1414        stack(T) ?=?( stack(T) & s, stack(T) t );
  • doc/papers/general/evaluation/cpp-stack.hpp

    r1518b39 rb9c432f  
    1010        node * head;
    1111
    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 ); }
    2014
    2115        void clear() {
     
    2822        }
    2923
    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
    3233        ~stack() { clear(); }
    3334
    34         stack & operator=( const stack<T> & o ) {
     35        stack & operator= ( const stack<T> & o ) {
    3536                if ( this == &o ) return *this;
    3637                clear();
     
    3940        }
    4041
    41         bool empty() const {
    42                 return head == nullptr;
    43         }
     42        bool empty() const { return head == nullptr; }
    4443
    45         void push( const T & value ) {
    46                 head = new node{ value, head };  /***/
    47         }
     44        void push( const T & value ) { head = new node{ value, head };  /***/ }
    4845
    4946        T pop() {
  • doc/papers/general/evaluation/cpp-vstack.cpp

    r1518b39 rb9c432f  
    33
    44stack::node::node( const object & v, node * n ) : value( v.new_copy() ), next( n ) {}
     5
     6void stack::clear() {
     7        for ( node * nx = head; nx; ) {
     8                node * cr = nx;
     9                nx = cr->next;
     10                delete cr;
     11        }
     12        head = nullptr;
     13}
    514
    615void stack::copy( const stack & o ) {
     
    1120        }
    1221        *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;
    2222}
    2323
     
    3333}
    3434
    35 bool stack::empty() const {
    36         return head == nullptr;
    37 }
     35bool stack::empty() const { return head == nullptr; }
    3836
    39 void stack::push( const object & value ) {
    40         head = new node{ value, head }; /***/
    41 }
     37void stack::push( const object & value ) { head = new node{ value, head }; /***/ }
    4238
    4339ptr<object> stack::pop() {
  • doc/papers/general/evaluation/cpp-vstack.hpp

    r1518b39 rb9c432f  
    1010        node * head;
    1111
     12        void clear();
    1213        void copy( const stack & o );
    13         void clear();
    1414
    1515        stack();
  • src/ResolvExpr/Resolver.cc

    r1518b39 rb9c432f  
    583583                                                                        ss << "' to '";
    584584                                                                        arg.expr->get_result()->print( ss );
    585                                                                         ss << "' with env '";
    586                                                                         resultEnv.print(ss);
    587585                                                                        ss << "'\n";
    588586                                                                        SemanticError( function, ss.str() );
  • src/benchmark/bench.h

    r1518b39 rb9c432f  
    66        #include <stdlib.h>
    77        #include <unistd.h>                                     // sysconf
     8        #include <sys/times.h>                                  // times
     9        #include <time.h>
    810#if defined(__cforall)
    911}
    10 #include <time>
     12//#include <bits/cfatime.h>
    1113#endif
    1214
    1315
    14 static inline unsigned long long int bench_time() {
     16static inline unsigned long long int Time() {
    1517    struct timespec ts;
    1618    clock_gettime(
     
    3941        }                                               \
    4042        long long int StartTime, EndTime;       \
    41         StartTime = bench_time();                       \
     43        StartTime = Time();                     \
    4244        statement;                                      \
    43         EndTime = bench_time();                         \
     45        EndTime = Time();                               \
    4446        unsigned long long int output =         \
    4547        ( EndTime - StartTime ) / n;
    4648
    47 Duration default_preemption() {
     49__cfa_time_t default_preemption() {
    4850        return 0;
    4951}
  • src/benchmark/ctxswitch/cfa_cor.c

    r1518b39 rb9c432f  
    11#include <stdio.h>
    2 #include <kernel>
    32#include <thread>
    43
  • src/libcfa/concurrency/thread

    r1518b39 rb9c432f  
    2020
    2121#include "coroutine"
    22 #include "kernel"
    2322#include "monitor"
    2423
Note: See TracChangeset for help on using the changeset viewer.