Changeset 3d8f2f8


Ignore:
Timestamp:
Mar 9, 2018, 1:28:54 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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.
Message:

more changes

Location:
doc/papers/general
Files:
6 edited

Legend:

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

    r8b001bd r3d8f2f8  
    26372637                                                                        & \CT{C}        & \CT{\CFA}     & \CT{\CC}      & \CT{\CCV}             \\ \hline
    26382638maximum memory usage (MB)                       & 10,001        & 2,502         & 2,503         & 11,253                \\
    2639 source code size (lines)                        & 197           & 186           & 133           & 303                   \\
     2639source code size (lines)                        & 197           & 186           & 125           & 293                   \\
    26402640redundant type annotations (lines)      & 27            & 0                     & 2                     & 16                    \\
    26412641binary size (KB)                                        & 14            & 257           & 14            & 37                    \\
     
    29062906}
    29072907\end{cfa}
     2908
     2909\begin{comment}
     2910forall( 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}
    29082958
    29092959\medskip\noindent
     
    29432993                return *this;
    29442994        }
    2945         stack & operator= ( stack<T> && o ) {
    2946                 if ( this == &o ) return *this;
    2947                 head = o.head;
    2948                 o.head = nullptr;
    2949                 return *this;
    2950         }
    29512995        bool empty() const { return head == nullptr; }
    29522996        void push( const T & value ) { head = new node{ value, head };  /***/ }
     
    29893033        stack() : head( nullptr ) {}
    29903034        stack( const stack & o ) { copy( o ); }
    2991         stack( stack && o ) : head( o.head ) { o.head = nullptr; }
    29923035        ~stack() { clear(); }
    2993         stack & operator=( const stack & o ) {
     3036        stack & operator= ( const stack & o ) {
    29943037                if ( this == &o ) return *this;
    29953038                clear();
    29963039                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;
    30033040                return *this;
    30043041        }
  • doc/papers/general/evaluation/cpp-stack.hpp

    r8b001bd r3d8f2f8  
    1111
    1212        stack() : head( nullptr ) {}
    13         stack( const stack<T> & o) { copy( o ); }
     13        stack( const stack<T> & o ) { copy( o ); }
    1414        stack( stack<T> && o ) : head( o.head ) { o.head = nullptr; }
    1515
     
    4141        }
    4242
    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 
    5043        bool empty() const { return head == nullptr; }
    5144
  • doc/papers/general/evaluation/cpp-vstack.hpp

    r8b001bd r3d8f2f8  
    1717        stack( stack && o );
    1818        ~stack();
    19         stack& operator=( const stack& o );
    20         stack& operator=( stack && o );
    21 
     19        stack & operator=( const stack& o );
     20        stack & operator=( stack && o );
    2221        bool empty() const;
    2322        void push( const object & value );
  • doc/papers/general/evaluation/timing.dat

    r8b001bd r3d8f2f8  
    11"400 million repetitions"       "C"     "\\CFA{}"       "\\CC{}"        "\\CC{obj}"
    2 "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
     2"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  
    2424set yrange [0:10]
    2525
    26 set label "26.5" at 7.125,10.5
     26set label "25.0" at 7.125,10.5
    2727
    2828# set datafile separator ","
Note: See TracChangeset for help on using the changeset viewer.