Changes in / [2183e12:4ae83a4b]


Ignore:
Location:
doc/generic_types
Files:
1 added
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/Makefile

    r2183e12 r4ae83a4b  
    3434
    3535CFILES = c-bench.c bench.h $(COBJS:.o=.h) $(COBJS:.o=.c)
    36 CPPFILES = cpp-bench.cpp bench.hpp cpp-stack.hpp cpp-print.hpp
     36CPPFILES = cpp-bench.cpp bench.hpp cpp-stack.hpp cpp-pair.hpp cpp-print.hpp
    3737CPPVFILES = cpp-vbench.cpp bench.hpp object.hpp $(CPPVOBJS:.o=.hpp) $(CPPVOBJS:.o=.cpp) cpp-vprint.hpp
    38 CFAFILES = cfa-bench.c bench.h cfa-stack.h cfa-print.h cfa-stack.c cfa-print.c
     38CFAFILES = cfa-bench.c bench.h $(CFAOBJS:.o=.h) $(CFAOBJS:.o=.c)
    3939
    4040c-bench: c-bench.c c-bench.d $(COBJS)
  • doc/generic_types/evaluation/bench.h

    r2183e12 r4ae83a4b  
    1313        printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \
    1414}
    15 #define REPEAT_N_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
    16 #define REPEAT_TIMED(name, code) REPEAT_N_TIMED(name, N, code)
     15#define REPEAT_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
  • doc/generic_types/evaluation/bench.hpp

    r2183e12 r4ae83a4b  
    1515                << std::setw(0) << " ms" << std::endl; \
    1616}
    17 #define REPEAT_N_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
    18 #define REPEAT_TIMED(name, code) REPEAT_N_TIMED(name, N, code)
     17#define REPEAT_TIMED(name, n, code) TIMED( name, for (int _i = 0; _i < n; ++_i) { code } )
  • doc/generic_types/evaluation/c-bench.c

    r2183e12 r4ae83a4b  
    3434}
    3535
    36 int cmp_char( const void* a, const void* b ) {
    37         return *(const char*)a == *(const char*)b ? 0 : *(const char*)a < *(const char*)b ? -1 : 1; /***/
     36int cmp_char( const void* a, const void* b ) { /***/
     37        return *(const char*)a == *(const char*)b ? 0 : *(const char*)a < *(const char*)b ? -1 : 1;
    3838}
    3939
    4040int main(int argc, char** argv) {
    41         FILE* out = fopen("c-out.txt", "w");
    42         int max = 0;
    43         struct stack s = new_stack(), t;
    44         REPEAT_TIMED( "push_int", push_stack(&s, new_int( _i )); )
    45         TIMED( "copy_int",      copy_stack(&t, &s, copy_int); /***/ )
    46         TIMED( "clear_int", clear_stack(&s, free); /***/ )
    47         REPEAT_TIMED( "pop_int",
    48                 int* x = pop_stack(&t); /***/
    49                 if ( *x > max ) { max = *x; }
    50                 free(x); )
    51         REPEAT_N_TIMED( "print_int", N/2, print( out, "dsds", _i, ":", _i, "\n" ); /***/ )
     41        FILE * out = fopen("c-out.txt", "w");
     42        int maxi = 0, vali = 42;
     43        struct stack si = new_stack(), ti;
    5244
    53         struct pair* max2 = new_pair( new_bool(0), new_char('\0') );
    54         struct stack s2 = new_stack(), t2;
     45        REPEAT_TIMED( "push_int", N, push_stack( &si, new_int( vali ) ); )
     46        TIMED( "copy_int",      copy_stack( &ti, &si, copy_int ); /***/ )
     47        TIMED( "clear_int", clear_stack( &si, free ); /***/ )
     48        REPEAT_TIMED( "pop_int", N,
     49                int* xi = pop_stack( &ti );
     50                if ( *xi > maxi ) { maxi = *xi; }
     51                free(xi); )
     52        REPEAT_TIMED( "print_int", N/2, print( out, "dsds", vali, ":", vali, "\n" ); /***/ )
    5553
    56         REPEAT_TIMED( "push_bool_char",
    57                 push_stack(&s2, new_pair( new_bool( _i & 0x1 ), new_char( _i & 0x7F ) )); )
    58         TIMED( "copy_bool_char", copy_stack(&t2, &s2, copy_pair_bool_char); /***/ )
    59         TIMED( "clear_bool_char", clear_stack(&s2, free_pair_bool_char); /***/ )
    60         REPEAT_TIMED( "pop_bool_char",
    61                 struct pair* x = pop_stack(&t2); /***/
    62                 if ( cmp_pair( x, max2, cmp_bool, cmp_char ) > 0 ) { /***/
    63                         free_pair_bool_char( max2 ); /***/
    64                         max2 = x;
     54        struct pair * maxp = new_pair( new_bool(0), new_char('\0') ),
     55                * valp = new_pair( new_bool(1), new_char('a') );
     56        struct stack sp = new_stack(), tp;
     57
     58        REPEAT_TIMED( "push_pair", N, push_stack( &sp, copy_pair_bool_char( valp ) ); )
     59        TIMED( "copy_pair", copy_stack( &tp, &sp, copy_pair_bool_char ); /***/ )
     60        TIMED( "clear_pair", clear_stack( &sp, free_pair_bool_char ); /***/ )
     61        REPEAT_TIMED( "pop_pair", N,
     62                struct pair * xp = pop_stack( &tp );
     63                if ( cmp_pair( xp, maxp, cmp_bool, cmp_char /***/ ) > 0 ) {
     64                        free_pair_bool_char( maxp ); /***/
     65                        maxp = xp;
    6566                } else {
    66                         free_pair_bool_char( x ); /***/
     67                        free_pair_bool_char( xp ); /***/
    6768                } )
    68         REPEAT_N_TIMED( "print_pair", N/2,
    69                 struct pair p1 = ((struct pair){ new_bool(rand() & 0x1), new_char(rand() & 0x7F) }); /***/
    70                 struct pair p2 = ((struct pair){ new_bool(rand() & 0x1), new_char(rand() & 0x7F) }); /***/
    71                 print( out, "pbcspbcs", p1, ":", p2, "\n" ); /***/
    72                 free(p1.first); free(p1.second); /***/
    73                 free(p2.first); free(p2.second); /***/ )
    74         free_pair_bool_char( max2 ); /***/
     69        REPEAT_TIMED( "print_pair", N/2, print( out, "pbcspbcs", *valp, ":", *valp, "\n" ); /***/ )
     70        free_pair_bool_char( maxp ); /***/
     71        free_pair_bool_char( valp ); /***/
    7572        fclose(out);
    7673}
  • doc/generic_types/evaluation/cfa-bench.c

    r2183e12 r4ae83a4b  
    11#include <stdlib>
    22#include <stdio.h>
    3 #include "pair"
    43#include "bench.h"
    54#include "cfa-stack.h"
     5#include "cfa-pair.h"
    66#include "cfa-print.h"
    77
    88int main( int argc, char *argv[] ) {
    99        FILE * out = fopen( "cfa-out.txt", "w" );
    10         int max = 0;
    11         stack(int) s, t;
     10        int maxi = 0, vali = 42;
     11        stack(int) si, ti;
    1212
    13         REPEAT_TIMED( "push_int", push( &s, _i ); )
    14         TIMED( "copy_int", t = s; )
    15         TIMED( "clear_int", clear( &s ); )
    16         REPEAT_TIMED( "pop_int",
    17                 int x = pop(&t);
    18                 if ( x > max ) { max = x; } )
    19         REPEAT_TIMED( "print_int", print( out, _i, ":", _i, "\n" ); )
     13        REPEAT_TIMED( "push_int", N, push( &si, vali ); )
     14        TIMED( "copy_int", ti = si; )
     15        TIMED( "clear_int", clear( &si ); )
     16        REPEAT_TIMED( "pop_int", N,
     17                int xi = pop( &ti );
     18                if ( xi > maxi ) { maxi = xi; } )
     19        REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )
    2020
    21         stack(pair(_Bool, char)) s1, t1;
    22         pair(_Bool, char) max = { (_Bool)0, '\0' };
     21        pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' };
     22        stack(pair(_Bool, char)) sp, tp;
    2323
    24         REPEAT_TIMED( "push_pair", push( &s1, (pair(_Bool, char)){ _i & 1, _i &0x7F } ); )
    25         TIMED( "copy_pair", t1 = s1; )
    26         TIMED( "clear_pair", clear( &s1 ); )
    27         REPEAT_TIMED( "pop_pair",
    28                 pair(_Bool, char) x = pop(&t1);
    29                 if ( x > max ) { max = x; } )
    30         REPEAT_TIMED( "print_pair",
    31                  print( out, (pair(_Bool, char)){  _i & 1, _i &0x7F }, ":",
    32                         (pair(_Bool, char)){  _i & 1, _i &0x7F }, "\n" ); )
     24        REPEAT_TIMED( "push_pair", N, push( &sp, valp ); )
     25        TIMED( "copy_pair", tp = sp; )
     26        TIMED( "clear_pair", clear( &sp ); )
     27        REPEAT_TIMED( "pop_pair", N,
     28                pair(_Bool, char) xp = pop( &tp );
     29                if ( xp > maxp ) { maxp = xp; } )
     30        REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )
    3331        fclose(out);
    3432}
  • doc/generic_types/evaluation/cfa-pair.c

    r2183e12 r4ae83a4b  
    1 #include "pair"
     1#include "cfa-pair.h"
    22
    33forall(otype R, otype S
  • doc/generic_types/evaluation/cfa-print.c

    r2183e12 r4ae83a4b  
    11#include <stdio.h>
    2 #include "pair"
     2#include "cfa-pair.h"
    33#include "cfa-print.h"
    44
  • doc/generic_types/evaluation/cfa-print.h

    r2183e12 r4ae83a4b  
    11#pragma once
    22#include <stdio.h>
    3 #include "pair"
     3#include "cfa-pair.h"
    44
    55forall(otype T, ttype Params | { void print(FILE*, T); void print(FILE*, Params); })
  • doc/generic_types/evaluation/cpp-bench.cpp

    r2183e12 r4ae83a4b  
    11#include <algorithm>
    22#include <fstream>
    3 #include <utility>
    43#include "bench.hpp"
    54#include "cpp-stack.hpp"
     5#include "cpp-pair.hpp"
    66#include "cpp-print.hpp"
    77
    88int main(int argc, char** argv) {
    99        std::ofstream out{"cpp-out.txt"};
    10         int max = 0;
    11         stack<int> s, t;
     10        int maxi = 0, vali = 42;
     11        stack<int> si, ti;
    1212       
    13         REPEAT_TIMED( "push_int", s.push( int{_i} ); )
    14         TIMED( "copy_int", t = s; )
    15         TIMED( "clear_int", s.clear(); )
    16         REPEAT_TIMED( "pop_int", max = std::max( max, t.pop() ); )
    17         print( out, max, "\n" );
    18         REPEAT_N_TIMED( "print_int", N/2, print( out, _i, ":", _i, "\n" ); )
     13        REPEAT_TIMED( "push_int", N, si.push( vali ); )
     14        TIMED( "copy_int", ti = si; )
     15        TIMED( "clear_int", si.clear(); )
     16        REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop() ); )
     17        REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )
    1918
    20         std::pair<bool, char> max1 = { false, '\0' };
    21         stack<std::pair<bool, char>> s1, t1;
     19        pair<bool, char> maxp = { false, '\0' }, valp = { true, 'a' };
     20        stack<pair<bool, char>> sp, tp;
    2221       
    23         REPEAT_TIMED( "push_bool_char", s1.push( std::pair<bool, char>{ _i & 0x1, _i & 0x7F } ); )
    24         TIMED( "copy_bool_char", t1 = s1; )
    25         TIMED( "clear_bool_char", s1.clear(); )
    26         REPEAT_TIMED( "pop_bool_char", max1 = std::max( max1, t1.pop() ); )
    27         print( out, max1, "\n" );
    28         REPEAT_N_TIMED( "print_pair", N/2,
    29                 print( out, std::pair<bool, char>{ _i & 0x1, _i & 0x7F }, ":",
    30                                 std::pair<bool, char>{ _i & 0x1, _i & 0x7F }, "\n" ); )
     22        REPEAT_TIMED( "push_pair", N, sp.push( valp ); )
     23        TIMED( "copy_pair", tp = sp; )
     24        TIMED( "clear_pair", sp.clear(); )
     25        REPEAT_TIMED( "pop_pair", N, maxp = std::max( maxp, tp.pop() ); )
     26        REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )
    3127}
  • doc/generic_types/evaluation/cpp-print.hpp

    r2183e12 r4ae83a4b  
    22#include <iomanip>
    33#include <iostream>
    4 #include <utility>
     4#include "cpp-pair.hpp"
    55
    66template<typename T> void print(std::ostream& out, const T& x) { out << x; }
     
    1414
    1515template<typename R, typename S>
    16 std::ostream& operator<< (std::ostream& out, const std::pair<R, S>& x) {
     16std::ostream& operator<< (std::ostream& out, const pair<R, S>& x) {
    1717        out << "[";
    1818        print(out, x.first);
  • doc/generic_types/evaluation/cpp-stack.hpp

    r2183e12 r4ae83a4b  
    77                node* next;
    88
    9                 node( T& v ) : value(v), next(nullptr) {}
    10                 node( T&& v, node* n ) : value(std::move(v)), next(n) {}
     9                node( const T& v, node* n = nullptr ) : value(v), next(n) {}
    1110        };
    1211        node* head;
     
    5453        bool empty() const { return head == nullptr; }
    5554
    56         void push(T&& value) { head = new node{ std::move(value), head };  /***/ }
     55        void push(const T& value) { head = new node{ value, head };  /***/ }
    5756
    5857        T pop() {
  • doc/generic_types/evaluation/cpp-vbench.cpp

    r2183e12 r4ae83a4b  
    88int main(int argc, char** argv) {
    99        std::ofstream out{"cpp-vout.txt"};
    10         integer max{ 0 };
    11         stack s, t;
     10        integer maxi{ 0 }, vali{ 42 };
     11        stack si, ti;
    1212       
    13         REPEAT_TIMED( "push_int", s.push( make<integer>( _i ) ); )
    14         TIMED( "copy_int", t = s; )
    15         TIMED( "clear_int", s.clear(); )
    16         REPEAT_TIMED( "pop_int", max = std::max( max, t.pop()->as<integer>() ); /***/ )
    17         print( out, max, c_string{"\n"} );
    18         REPEAT_N_TIMED( "print_int", N/2,
    19                 print( out, integer{_i}, c_string{":"}, integer{_i}, c_string{"\n"} ); )
     13        REPEAT_TIMED( "push_int", N, si.push( vali ); )
     14        TIMED( "copy_int", ti = si; )
     15        TIMED( "clear_int", si.clear(); )
     16        REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop()->as<integer>() ); /***/ )
     17        REPEAT_TIMED( "print_int", N/2, print( out, vali, c_string{":"}, vali, c_string{"\n"} ); )
    2018
    21         ptr<pair> max1 = make<pair>( make<boolean>(false), make<character>('\0') );
    22         stack s1, t1;
     19        ptr<pair> maxp = make<pair>( make<boolean>(false), make<character>('\0') );
     20        pair valp{ make<boolean>(true), make<character>('a') };
     21        stack sp, tp;
    2322       
    24         REPEAT_TIMED( "push_bool_char",
    25                 s1.push( make<pair>( make<boolean>(_i & 1), make<character>(_i & 0x7F) ) ); )
    26         TIMED( "copy_bool_char", t1 = s1; )
    27         TIMED( "clear_bool_char", s1.clear(); )
    28         REPEAT_TIMED( "pop_bool_char",
    29                 ptr<pair> x = as_ptr<pair>( t1.pop() ); /***/
    30                 if ( *x > *max1 ) { max1 = std::move(x); } )
    31         print( out, *max1, c_string{"\n"} );
    32         REPEAT_N_TIMED( "print_pair", N/2,
    33                 print( out, pair{ make<boolean>(_i & 1), make<character>(_i & 0x7F) }, c_string{":"},
    34                         pair{ make<boolean>(_i & 1), make<character>(_i & 0x7F) }, c_string{"\n"} ); )
     23        REPEAT_TIMED( "push_pair", N, sp.push( valp ); )
     24        TIMED( "copy_pair", tp = sp; )
     25        TIMED( "clear_pair", sp.clear(); )
     26        REPEAT_TIMED( "pop_pair", N,
     27                ptr<pair> xp = as_ptr<pair>( tp.pop() ); /***/
     28                if ( *xp > *maxp ) { maxp = std::move(xp); } )
     29        REPEAT_TIMED( "print_pair", N/2, print( out, valp, c_string{":"}, valp, c_string{"\n"} ); )
    3530}
  • doc/generic_types/evaluation/cpp-vstack.cpp

    r2183e12 r4ae83a4b  
    22#include <utility>
    33
    4 stack::node::node( const object& v ) : value( v.new_copy() ), next( nullptr ) {}
    5 stack::node::node( ptr<object>&& v, node* n ) : value( std::move(v) ), next( n ) {}
     4stack::node::node( const object& v, node* n ) : value( v.new_copy() ), next( n ) {}
    65
    76void stack::copy(const stack& o) {
     
    4847bool stack::empty() const { return head == nullptr; }
    4948
    50 void stack::push(ptr<object>&& value) { head = new node{ std::move(value), head }; /***/ }
     49void stack::push(const object& value) { head = new node{ value, head }; /***/ }
    5150
    5251ptr<object> stack::pop() {
  • doc/generic_types/evaluation/cpp-vstack.hpp

    r2183e12 r4ae83a4b  
    77                node* next;
    88
    9                 node( const object& v );
    10                 node( ptr<object>&& v, node* n );
     9                node( const object& v, node* n = nullptr );
    1110        };
    1211        node* head;
     
    2322        void clear();
    2423        bool empty() const;
    25         void push(ptr<object>&& value);
     24        void push(const object& value);
    2625        ptr<object> pop();
    2726};
  • doc/generic_types/evaluation/object.hpp

    r2183e12 r4ae83a4b  
    7272        boolean() = default;
    7373        boolean(bool x) : x(x) {}
     74        boolean(const boolean&) = default;
     75        boolean(boolean&&) = default;
    7476        ptr<object> new_inst() const override { return make<boolean>(); }
    7577        ptr<object> new_copy() const override { return make<boolean>(*this); }
     
    7981        }
    8082        object& operator= (const object& that) override { return *this = that.as<boolean>(); } /***/
     83        boolean& operator= (boolean&&) = default;
    8184        ~boolean() override = default;
    8285
     
    9295        character() = default;
    9396        character(char x) : x(x) {}
     97        character(const character&) = default;
     98        character(character&&) = default;
    9499        ptr<object> new_inst() const override { return make<character>(); }
    95100        ptr<object> new_copy() const override { return make<character>(*this); }
     
    99104        }
    100105        object& operator= (const object& that) override { return *this = that.as<character>(); } /***/
     106        character& operator= (character&&) = default;
    101107        ~character() override = default;
    102108
     
    115121        integer() = default;
    116122        integer(int x) : x(x) {}
     123        integer(const integer&) = default;
     124        integer(integer&&) = default;
    117125        ptr<object> new_inst() const override { return make<integer>(); }
    118126        ptr<object> new_copy() const override { return make<integer>(*this); }
     
    122130        }
    123131        object& operator= (const object& that) override { return *this = that.as<integer>(); } /***/
     132        integer& operator= (integer&&) = default;
    124133        ~integer() override = default;
    125134
     
    136145        c_string() : s(empty) {}
    137146        c_string(const char* s) : s(s) {}
     147        c_string(const c_string&) = default;
     148        c_string(c_string&&) = default;
    138149        ptr<object> new_inst() const override { return make<c_string>(); }
    139150        ptr<object> new_copy() const override { return make<c_string>(s); }
     
    143154        }
    144155        object& operator= (const object& that) override { return *this = that.as<c_string>(); } /***/
     156        c_string& operator= (c_string&&) = default;
    145157        ~c_string() override = default;
    146158
     
    154166        pair() = default;
    155167        pair(ptr<object>&& x, ptr<object>&& y) : x(std::move(x)), y(std::move(y)) {}
     168        pair(const pair& that) : x(that.x->new_copy()), y(that.y->new_copy()) {}
     169        pair(pair&& that) : x(std::move(that.x)), y(std::move(that.y)) {}
    156170        ptr<object> new_inst() const override { return make<pair>(); }
    157171        ptr<object> new_copy() const override { return make<pair>(x->new_copy(), y->new_copy()); }
     
    162176        }
    163177        object& operator= (const object& that) override { return *this = that.as<pair>(); } /***/
     178        pair& operator= (pair&& that) {
     179                x = std::move(that.x);
     180                y = std::move(that.y);
     181                return *this;
     182        }
    164183        ~pair() override = default;
    165184
  • doc/generic_types/evaluation/timing.dat

    r2183e12 r4ae83a4b  
    11"400 million repetitions"       "C"     "\\CFA{}"       "\\CC{}"        "\\CC{obj}"
    2 "push\nint"     3324    2263    1583    3141
    3 "copy\nint"     2999    2055    1560    3136
    4 "clear\nint"    1384    816     754     1498
    5 "pop\nint"      1413    1172    751     5344
    6 "print\nint"    7106    12458   3976    4044
    7 "push\npair"    4916    3139    1014    6407
    8 "copy\npair"    6218    2077    1002    7067
    9 "clear\npair"   2777    886     722     3519
    10 "pop\npair"     2857    4200    784     21145
    11 "print\npair"   13536   21726   9009    20516
    12 
     2"push\nint"     2958    2480    1519    3284
     3"copy\nint"     2961    2014    1534    3126
     4"clear\nint"    1350    817     722     1459
     5"pop\nint"      1386    1174    717     5404
     6"print\nint"    5702    6615    3077    3191
     7"push\npair"    4160    2648    940     6566
     8"copy\npair"    6195    2099    977     7234
     9"clear\npair"   2834    863     723     3315
     10"pop\npair"     2956    5591    775     26256
     11"print\npair"   7498    10804   8750    16638
  • doc/generic_types/generic_types.tex

    r2183e12 r4ae83a4b  
    964964\begin{figure}
    965965\begin{lstlisting}[xleftmargin=3\parindentlnth,aboveskip=0pt,belowskip=0pt]
    966 int main( int argc, char * argv[] ) {
     966int main( int argc, char *argv[] ) {
    967967        FILE * out = fopen( "cfa-out.txt", "w" );
    968         int max = 0, vali = 42;
     968        int maxi = 0, vali = 42;
    969969        stack(int) si, ti;
    970970
    971         REPEAT_TIMED( "push_int", push( &si, vali ); )
     971        REPEAT_TIMED( "push_int", N, push( &si, vali ); )
    972972        TIMED( "copy_int", ti = si; )
    973973        TIMED( "clear_int", clear( &si ); )
    974         REPEAT_TIMED( "pop_int", max = max( max, pop( &ti ) ); )
    975         REPEAT_TIMED( "print_int", print( out, vali, ":", vali, "\n" ); )
    976 
    977         pair(_Bool, char) maxp  = { (_Bool)0, '\0' }, valp = { (_Bool)0, 'a' };
     974        REPEAT_TIMED( "pop_int", N,
     975                int xi = pop( &ti );
     976                if ( xi > maxi ) { maxi = xi; } )
     977        REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )
     978
     979        pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' };
    978980        stack(pair(_Bool, char)) sp, tp;
    979981
    980         REPEAT_TIMED( "push_pair", push( &sp, valp ); )
     982        REPEAT_TIMED( "push_pair", N, push( &sp, valp ); )
    981983        TIMED( "copy_pair", tp = sp; )
    982984        TIMED( "clear_pair", clear( &sp ); )
    983         REPEAT_TIMED( "pop_pair", maxp = max( maxp, pop( &tp ) ); )
    984         REPEAT_TIMED( "print_pair", print( out, valp, ":", valp, "\n" ); )
     985        REPEAT_TIMED( "pop_pair", N,
     986                pair(_Bool, char) xp = pop( &tp );
     987                if ( xp > maxp ) { maxp = xp; } )
     988        REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )
    985989        fclose(out);
    986990}
     
    10081012\begin{tabular}{rrrrr}
    10091013                                                                        & \CT{C}        & \CT{\CFA}     & \CT{\CC}      & \CT{\CCV}             \\ \hline
    1010 maximum memory usage (MB)                       & 10001         & 2501          & 2503          & 11253                 \\
    1011 source code size (lines)                        & 301           & 224           & 188           & 437                   \\
    1012 redundant type annotations (lines)      & 46            & 3                     & 2                     & 15                    \\
    1013 binary size (KB)                                        & 18            & 234           & 18            & 42                    \\
     1014maximum memory usage (MB)                       & 10001         & 2502          & 2503          & 11253                 \\
     1015source code size (lines)                        & 247           & 223           & 165           & 339                   \\
     1016redundant type annotations (lines)      & 39            & 2                     & 2                     & 15                    \\
     1017binary size (KB)                                        & 14            & 229           & 18            & 38                    \\
    10141018\end{tabular}
    10151019\end{table}
Note: See TracChangeset for help on using the changeset viewer.