Changes in / [5b7a60c8:99cad3aa]


Ignore:
Location:
src
Files:
2 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r5b7a60c8 r99cad3aa  
    4949}
    5050
    51 template< typename T, typename U >
    52 static inline T * maybeMoveBuild( const U *orig ) {
    53         T* ret = maybeBuild<T>(orig);
    54         delete orig;
    55         return ret;
    56 }
    57 
    58 
    5951template< typename Input_iterator >
    6052void printEnums( Input_iterator begin, Input_iterator end, const char * const *name_array, std::ostream &os ) {
  • src/Parser/ExpressionNode.cc

    r5b7a60c8 r99cad3aa  
    167167
    168168NameExpr * build_varref( const string *name, bool labelp ) {
    169         NameExpr *expr = new NameExpr( *name, nullptr );
    170         delete name;
    171         return expr;
     169        return new NameExpr( *name, nullptr );
    172170}
    173171
     
    186184        if ( dynamic_cast< VoidType * >( targetType ) ) {
    187185                delete targetType;
    188                 return new CastExpr( maybeMoveBuild< Expression >(expr_node) );
     186                return new CastExpr( maybeBuild< Expression >(expr_node) );
    189187        } else {
    190                 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType );
     188                return new CastExpr( maybeBuild< Expression >(expr_node), targetType );
    191189        } // if
    192190}
    193191
    194192Expression *build_fieldSel( ExpressionNode *expr_node, NameExpr *member ) {
    195         UntypedMemberExpr *ret = new UntypedMemberExpr( member->get_name(), maybeMoveBuild< Expression >(expr_node) );
     193        UntypedMemberExpr *ret = new UntypedMemberExpr( member->get_name(), maybeBuild< Expression >(expr_node) );
    196194        delete member;
    197195        return ret;
     
    200198Expression *build_pfieldSel( ExpressionNode *expr_node, NameExpr *member ) {
    201199        UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
    202         deref->get_args().push_back( maybeMoveBuild< Expression >(expr_node) );
     200        deref->get_args().push_back( maybeBuild< Expression >(expr_node) );
    203201        UntypedMemberExpr *ret = new UntypedMemberExpr( member->get_name(), deref );
    204202        delete member;
     
    207205
    208206Expression *build_addressOf( ExpressionNode *expr_node ) {
    209                 return new AddressExpr( maybeMoveBuild< Expression >(expr_node) );
     207                return new AddressExpr( maybeBuild< Expression >(expr_node) );
    210208}
    211209Expression *build_sizeOfexpr( ExpressionNode *expr_node ) {
    212         return new SizeofExpr( maybeMoveBuild< Expression >(expr_node) );
     210        return new SizeofExpr( maybeBuild< Expression >(expr_node) );
    213211}
    214212Expression *build_sizeOftype( DeclarationNode *decl_node ) {
     
    216214}
    217215Expression *build_alignOfexpr( ExpressionNode *expr_node ) {
    218         return new AlignofExpr( maybeMoveBuild< Expression >(expr_node) );
     216        return new AlignofExpr( maybeBuild< Expression >(expr_node) );
    219217}
    220218Expression *build_alignOftype( DeclarationNode *decl_node ) {
     
    226224
    227225Expression *build_and_or( ExpressionNode *expr_node1, ExpressionNode *expr_node2, bool kind ) {
    228         return new LogicalExpr( notZeroExpr( maybeMoveBuild< Expression >(expr_node1) ), notZeroExpr( maybeMoveBuild< Expression >(expr_node2) ), kind );
     226        return new LogicalExpr( notZeroExpr( maybeBuild< Expression >(expr_node1) ), notZeroExpr( maybeBuild< Expression >(expr_node2) ), kind );
    229227}
    230228
    231229Expression *build_unary_val( OperKinds op, ExpressionNode *expr_node ) {
    232230        std::list< Expression * > args;
    233         args.push_back( maybeMoveBuild< Expression >(expr_node) );
     231        args.push_back( maybeBuild< Expression >(expr_node) );
    234232        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
    235233}
    236234Expression *build_unary_ptr( OperKinds op, ExpressionNode *expr_node ) {
    237235        std::list< Expression * > args;
    238         args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) );
     236        args.push_back( new AddressExpr( maybeBuild< Expression >(expr_node) ) );
    239237        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
    240238}
    241239Expression *build_binary_val( OperKinds op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) {
    242240        std::list< Expression * > args;
    243         args.push_back( maybeMoveBuild< Expression >(expr_node1) );
    244         args.push_back( maybeMoveBuild< Expression >(expr_node2) );
     241        args.push_back( maybeBuild< Expression >(expr_node1) );
     242        args.push_back( maybeBuild< Expression >(expr_node2) );
    245243        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
    246244}
    247245Expression *build_binary_ptr( OperKinds op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) {
    248246        std::list< Expression * > args;
    249         args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node1) ) );
    250         args.push_back( maybeMoveBuild< Expression >(expr_node2) );
     247        args.push_back( new AddressExpr( maybeBuild< Expression >(expr_node1) ) );
     248        args.push_back( maybeBuild< Expression >(expr_node2) );
    251249        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
    252250}
    253251
    254252Expression *build_cond( ExpressionNode *expr_node1, ExpressionNode *expr_node2, ExpressionNode *expr_node3 ) {
    255         return new ConditionalExpr( notZeroExpr( maybeMoveBuild< Expression >(expr_node1) ), maybeMoveBuild< Expression >(expr_node2), maybeMoveBuild< Expression >(expr_node3) );
     253        return new ConditionalExpr( notZeroExpr( maybeBuild< Expression >(expr_node1) ), maybeBuild< Expression >(expr_node2), maybeBuild< Expression >(expr_node3) );
    256254}
    257255
    258256Expression *build_comma( ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) {
    259         return new CommaExpr( maybeMoveBuild< Expression >(expr_node1), maybeMoveBuild< Expression >(expr_node2) );
     257        return new CommaExpr( maybeBuild< Expression >(expr_node1), maybeBuild< Expression >(expr_node2) );
    260258}
    261259
    262260Expression *build_attrexpr( NameExpr *var, ExpressionNode * expr_node ) {
    263         return new AttrExpr( var, maybeMoveBuild< Expression >(expr_node) );
     261        return new AttrExpr( var, maybeBuild< Expression >(expr_node) );
    264262}
    265263Expression *build_attrtype( NameExpr *var, DeclarationNode * decl_node ) {
     
    269267Expression *build_tuple( ExpressionNode * expr_node ) {
    270268        TupleExpr *ret = new TupleExpr();
    271         buildMoveList( expr_node, ret->get_exprs() );
     269        buildList( expr_node, ret->get_exprs() );
    272270        return ret;
    273271}
     
    275273Expression *build_func( ExpressionNode * function, ExpressionNode * expr_node ) {
    276274        std::list< Expression * > args;
    277         buildMoveList( expr_node, args );
    278         return new UntypedExpr( maybeMoveBuild< Expression >(function), args, nullptr );
     275
     276        buildList( expr_node, args );
     277        return new UntypedExpr( maybeBuild< Expression >(function), args, nullptr );
    279278}
    280279
    281280Expression *build_range( ExpressionNode * low, ExpressionNode *high ) {
    282         return new RangeExpr( maybeMoveBuild< Expression >( low ), maybeMoveBuild< Expression >( high ) );
     281        Expression *low_cexpr = maybeBuild< Expression >( low );
     282        Expression *high_cexpr = maybeBuild< Expression >( high );
     283        return new RangeExpr( low_cexpr, high_cexpr );
    283284}
    284285
    285286Expression *build_asmexpr( ExpressionNode *inout, ConstantExpr *constraint, ExpressionNode *operand ) {
    286         return new AsmExpr( maybeMoveBuild< Expression >( inout ), constraint, maybeMoveBuild< Expression >(operand) );
     287        return new AsmExpr( maybeBuild< Expression >( inout ), constraint, maybeBuild< Expression >(operand) );
    287288}
    288289
    289290Expression *build_valexpr( StatementNode *s ) {
    290         return new UntypedValofExpr( maybeMoveBuild< Statement >(s), nullptr );
     291        return new UntypedValofExpr( maybeBuild< Statement >(s), nullptr );
    291292}
    292293Expression *build_typevalue( DeclarationNode *decl ) {
     
    297298        Declaration * newDecl = maybeBuild< Declaration >(decl_node); // compound literal type
    298299        if ( DeclarationWithType * newDeclWithType = dynamic_cast< DeclarationWithType * >( newDecl ) ) { // non-sue compound-literal type
    299                 return new CompoundLiteralExpr( newDeclWithType->get_type(), maybeMoveBuild< Initializer >(kids) );
     300                return new CompoundLiteralExpr( newDeclWithType->get_type(), maybeBuild< Initializer >(kids) );
    300301        // these types do not have associated type information
    301302        } else if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( newDecl )  ) {
    302                 return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), maybeMoveBuild< Initializer >(kids) );
     303                return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), maybeBuild< Initializer >(kids) );
    303304        } else if ( UnionDecl * newDeclUnionDecl = dynamic_cast< UnionDecl * >( newDecl )  ) {
    304                 return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), maybeMoveBuild< Initializer >(kids) );
     305                return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), maybeBuild< Initializer >(kids) );
    305306        } else if ( EnumDecl * newDeclEnumDecl = dynamic_cast< EnumDecl * >( newDecl )  ) {
    306                 return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), maybeMoveBuild< Initializer >(kids) );
     307                return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), maybeBuild< Initializer >(kids) );
    307308        } else {
    308309                assert( false );
  • src/Parser/ParseNode.h

    r5b7a60c8 r99cad3aa  
    387387void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList );
    388388
    389 template< typename SynTreeType, typename NodeType >
    390 void buildMoveList( const NodeType *firstNode, std::list< SynTreeType * > &outputList ) {
    391         buildList(firstNode, outputList);
    392         delete firstNode;
    393 }
    394 
    395 
    396389#endif // PARSENODE_H
    397390
  • src/Parser/StatementNode.cc

    r5b7a60c8 r99cad3aa  
    6262        StatementNode *node = dynamic_cast< StatementNode * >(prev);
    6363        std::list< Statement * > stmts;
    64         buildMoveList( stmt, stmts );
     64        buildList( stmt, stmts );
    6565        // splice any new Statements to end of current Statements
    6666        CaseStmt * caseStmt = dynamic_cast< CaseStmt * >(node->stmt);
     
    7070
    7171Statement *build_expr( ExpressionNode *ctl ) {
    72         Expression *e = maybeMoveBuild< Expression >( ctl );
     72        Expression *e = maybeBuild< Expression >( ctl );
    7373
    7474        if ( e )
     
    8181        Statement *thenb, *elseb = 0;
    8282        std::list< Statement * > branches;
    83         buildMoveList< Statement, StatementNode >( then_stmt, branches );
     83        buildList< Statement, StatementNode >( then_stmt, branches );
    8484        assert( branches.size() == 1 );
    8585        thenb = branches.front();
     
    8787        if ( else_stmt ) {
    8888                std::list< Statement * > branches;
    89                 buildMoveList< Statement, StatementNode >( else_stmt, branches );
     89                buildList< Statement, StatementNode >( else_stmt, branches );
    9090                assert( branches.size() == 1 );
    9191                elseb = branches.front();
    9292        } // if
    93         return new IfStmt( noLabels, notZeroExpr( maybeMoveBuild< Expression >(ctl) ), thenb, elseb );
     93        return new IfStmt( noLabels, notZeroExpr( maybeBuild< Expression >(ctl) ), thenb, elseb );
    9494}
    9595
    9696Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) {
    9797        std::list< Statement * > branches;
    98         buildMoveList< Statement, StatementNode >( stmt, branches );
     98        buildList< Statement, StatementNode >( stmt, branches );
    9999        assert( branches.size() >= 0 );                                         // size == 0 for switch (...) {}, i.e., no declaration or statements
    100         return new SwitchStmt( noLabels, maybeMoveBuild< Expression >(ctl), branches );
     100        return new SwitchStmt( noLabels, maybeBuild< Expression >(ctl), branches );
    101101}
    102102Statement *build_case( ExpressionNode *ctl ) {
    103103        std::list< Statement * > branches;
    104         return new CaseStmt( noLabels, maybeMoveBuild< Expression >(ctl), branches );
     104        return new CaseStmt( noLabels, maybeBuild< Expression >(ctl), branches );
    105105}
    106106Statement *build_default() {
     
    111111Statement *build_while( ExpressionNode *ctl, StatementNode *stmt, bool kind ) {
    112112        std::list< Statement * > branches;
    113         buildMoveList< Statement, StatementNode >( stmt, branches );
     113        buildList< Statement, StatementNode >( stmt, branches );
    114114        assert( branches.size() == 1 );
    115         return new WhileStmt( noLabels, notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), kind );
     115        return new WhileStmt( noLabels, notZeroExpr( maybeBuild< Expression >(ctl) ), branches.front(), kind );
    116116}
    117117
    118118Statement *build_for( ForCtl *forctl, StatementNode *stmt ) {
    119119        std::list< Statement * > branches;
    120         buildMoveList< Statement, StatementNode >( stmt, branches );
     120        buildList< Statement, StatementNode >( stmt, branches );
    121121        assert( branches.size() == 1 );
    122122
    123123        std::list< Statement * > init;
    124124        if ( forctl->init != 0 ) {
    125                 buildMoveList( forctl->init, init );
     125                buildList( forctl->init, init );
    126126        } // if
    127127
    128128        Expression *cond = 0;
    129129        if ( forctl->condition != 0 )
    130                 cond = notZeroExpr( maybeMoveBuild< Expression >(forctl->condition) );
     130                cond = notZeroExpr( maybeBuild< Expression >(forctl->condition) );
    131131
    132132        Expression *incr = 0;
    133133        if ( forctl->change != 0 )
    134                 incr = maybeMoveBuild< Expression >(forctl->change);
     134                incr = maybeBuild< Expression >(forctl->change);
    135135
    136136        delete forctl;
     
    142142}
    143143Statement *build_computedgoto( ExpressionNode *ctl ) {
    144         return new BranchStmt( noLabels, maybeMoveBuild< Expression >(ctl), BranchStmt::Goto );
     144        return new BranchStmt( noLabels, maybeBuild< Expression >(ctl), BranchStmt::Goto );
    145145}
    146146
    147147Statement *build_return( ExpressionNode *ctl ) {
    148148        std::list< Expression * > exps;
    149         buildMoveList( ctl, exps );
     149        buildList( ctl, exps );
    150150        return new ReturnStmt( noLabels, exps.size() > 0 ? exps.back() : nullptr );
    151151}
    152152Statement *build_throw( ExpressionNode *ctl ) {
    153153        std::list< Expression * > exps;
    154         buildMoveList( ctl, exps );
     154        buildList( ctl, exps );
    155155        return new ReturnStmt( noLabels, exps.size() > 0 ? exps.back() : nullptr, true );
    156156}
     
    158158Statement *build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt ) {
    159159        std::list< Statement * > branches;
    160         buildMoveList< Statement, StatementNode >( catch_stmt, branches );
    161         CompoundStmt *tryBlock = dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));
     160        buildList< Statement, StatementNode >( catch_stmt, branches );
     161        CompoundStmt *tryBlock = dynamic_cast< CompoundStmt * >(maybeBuild< Statement >(try_stmt));
    162162        assert( tryBlock );
    163         FinallyStmt *finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) );
     163        FinallyStmt *finallyBlock = dynamic_cast< FinallyStmt * >(maybeBuild< Statement >(finally_stmt) );
    164164        return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
    165165}
    166166Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny ) {
    167167        std::list< Statement * > branches;
    168         buildMoveList< Statement, StatementNode >( stmt, branches );
     168        buildList< Statement, StatementNode >( stmt, branches );
    169169        assert( branches.size() == 1 );
    170         return new CatchStmt( noLabels, maybeMoveBuild< Declaration >(decl), branches.front(), catchAny );
     170        return new CatchStmt( noLabels, maybeBuild< Declaration >(decl), branches.front(), catchAny );
    171171}
    172172Statement *build_finally( StatementNode *stmt ) {
    173173        std::list< Statement * > branches;
    174         buildMoveList< Statement, StatementNode >( stmt, branches );
     174        buildList< Statement, StatementNode >( stmt, branches );
    175175        assert( branches.size() == 1 );
    176176        return new FinallyStmt( noLabels, dynamic_cast< CompoundStmt * >( branches.front() ) );
     
    179179Statement *build_compound( StatementNode *first ) {
    180180        CompoundStmt *cs = new CompoundStmt( noLabels );
    181         buildMoveList( first, cs->get_kids() );
     181        buildList( first, cs->get_kids() );
    182182        return cs;
    183183}
     
    187187        std::list< ConstantExpr * > clob;
    188188
    189         buildMoveList( output, out );
    190         buildMoveList( input, in );
    191         buildMoveList( clobber, clob );
     189        buildList( output, out );
     190        buildList( input, in );
     191        buildList( clobber, clob );
    192192        return new AsmStmt( noLabels, voltile, instruction, out, in, clob, gotolabels ? gotolabels->labels : noLabels );
    193193}
  • src/examples/gc_no_raii/premake4.lua

    r5b7a60c8 r99cad3aa  
    66        "src/",
    77        "../",
    8         "containers/"
    98}
    109
     
    4948                linkoptions (linkOptionList)
    5049                includedirs (includeDirList)
    51                 files { "src/**.c", "containers/**.c" }
     50                files { "src/**.c" }
    5251
    5352        configuration "debug"
  • src/examples/gc_no_raii/src/gc.h

    r5b7a60c8 r99cad3aa  
    44#include "internal/collector.h"
    55
    6 // forall(otype T)
    7 // static inline gcpointer(T) gcmalloc()
    8 // {
    9 //     gcpointer(T) ptr = { gc_allocate(sizeof(T)) };
    10 //     ptr{};
    11 //     gc_conditional_collect();
    12 //     return ptr;
    13 // }
     6forall(otype T)
     7static inline gcpointer(T) gcmalloc()
     8{
     9    gcpointer(T) ptr = { gc_allocate(sizeof(T)) };
     10    ptr{};
     11    gc_conditional_collect();
     12    return ptr;
     13}
    1414
    1515forall(otype T)
    1616static inline void gcmalloc(gcpointer(T)* ptr)
    1717{
    18         ptr { gc_allocate(sizeof(T)) };
    19         get(ptr) {};
     18        ptr{ gc_allocate(sizeof(T)) };
     19      (*ptr){};
    2020      gc_conditional_collect();
    2121}
  • src/examples/gc_no_raii/src/gcpointers.c

    r5b7a60c8 r99cad3aa  
    4242}
    4343
    44 void ?{}(gcpointer_t* this)
     44void gcpointer_ctor(gcpointer_t* this)
    4545{
    4646        this->ptr = (intptr_t)NULL;
     
    4848}
    4949
    50 void ?{}(gcpointer_t* this, void* address)
     50void gcpointer_ctor(gcpointer_t* this, void* address)
    5151{
    5252        this->ptr = (intptr_t)address;
     
    5656}
    5757
    58 void ?{}(gcpointer_t* this, gcpointer_t other)
     58void gcpointer_ctor(gcpointer_t* this, gcpointer_t* other)
    5959{
    60         this->ptr = other.ptr;
     60        this->ptr = other->ptr;
    6161        this->next = NULL;
    6262
     
    6464}
    6565
    66 void ^?{}(gcpointer_t* this)
     66void gcpointer_dtor(gcpointer_t* this)
    6767{
    6868        unregister_ptr(this);
     
    9898        return this->ptr == (intptr_t)NULL;
    9999}
    100 
    101 forall(otype T) void ?{}(gcpointer(T)* this) {
    102         (&this->internal) {};
    103 }
    104 
    105 forall(otype T) void ?{}(gcpointer(T)* this, void* address) {
    106         (&this->internal) { address };
    107 }
    108 
    109 forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other) {
    110         (&this->internal) { other->internal };
    111 }
    112 
    113 forall(otype T) void ^?{}(gcpointer(T)* this) {
    114         ^?{}(&this->internal);
    115 }
    116 
    117 // forall(otype T) gcpointer(T) ?=?(gcpointer(T) this, gcpointer(T) rhs);
    118 //
    119 // forall(otype T) T *?(gcpointer(T) this);
    120 
    121 forall(otype T) T* get(gcpointer(T)* this) {
    122         return (T*)this->internal.ptr;
    123 }
    124 //
    125 // //Logical operators
    126 // forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
    127 // forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
  • src/examples/gc_no_raii/src/gcpointers.h

    r5b7a60c8 r99cad3aa  
    3030forall(otype T) void ?{}(gcpointer(T)* this);
    3131forall(otype T) void ?{}(gcpointer(T)* this, void* address);
     32forall(otype T) void ctor(gcpointer(T)* this, void* address);
    3233forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other);
    3334forall(otype T) void ^?{}(gcpointer(T)* this);
     
    3637
    3738forall(otype T) T *?(gcpointer(T) this);
    38 forall(otype T) T* get(gcpointer(T)* this);
    3939
    4040//Logical operators
  • src/examples/gc_no_raii/src/internal/collector.c

    r5b7a60c8 r99cad3aa  
    88}
    99#endif
    10 
    11 #include <fstream>
    1210
    1311#include "state.h"
     
    3836void* gc_allocate(size_t target_size)
    3937{
    40         sout | "Allocating " | target_size | " bytes" | endl;
    41 
    4238        size_t size = gc_compute_size(target_size + sizeof(gc_object_header));
    43 
    44         sout | "Object header size: " | sizeof(gc_object_header) | " bytes" | endl;
    45         sout | "Actual allocation size: " | size | " bytes" | endl;
    4639
    4740        check(size < POOL_SIZE_BYTES);
  • src/examples/gc_no_raii/src/internal/state.h

    r5b7a60c8 r99cad3aa  
    99}
    1010#endif
    11 #include <fstream>
    1211#include <vector>
    1312
     
    3837static inline bool gc_needs_collect(gc_state* state)
    3938{
    40         sout | "Used Space: " | state->used_space | " bytes" | endl;
    4139        return state->used_space * 2 > state->total_space;
    4240}
  • src/examples/gc_no_raii/test/gctest.c

    r5b7a60c8 r99cad3aa  
    22
    33#include "gc.h"
    4 #include "internal/collector.h"
    54
    65#warning default test
     
    98        sout | "Bonjour au monde!\n";
    109
    11         gcpointer(int) theInt;
    12         gcmalloc(&theInt);
    13 
    14         for(int i = 0; i < 10; i++) {
    15                 int a;
    16                 {
    17                         gcpointer(int) anInt;
    18                         gcmalloc(&anInt);
    19                 }
    20                 int p;
     10        for(int i = 0; i < 1000000; i++) {
     11                gcpointer(int) anInt;
     12                gcmalloc(&anInt);
    2113        }
    22 
    23         gc_collect(gc_get_state());
    24         gc_conditional_collect();
    2514}
Note: See TracChangeset for help on using the changeset viewer.