Changeset 508

Show
Ignore:
Timestamp:
02/08/08 18:56:30 (8 months ago)
Author:
krobillard
Message:

GC was inadvertently disabled.
Fixed some GC bugs.
Print & recycle now handle macro!.
Fixed bug in ur_release().

Location:
trunk/thune
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/gc.c

    r502 r508  
    302302            case UT_BLOCK: 
    303303            case UT_PAREN: 
     304            case UT_MACRO: 
    304305                idx = it->series.n; 
    305306                if( ur_isLocal(idx) ) 
     
    336337 
    337338                idx = it->err.traceBlk; 
    338                 if( idx ) 
     339                if( idx > 0 ) 
    339340                    SET_BIT_BLOCK( idx ) 
    340341                break; 
     
    376377                SET_BIT_BLOCK_L( it->func.bodyN ) 
    377378                idx = it->func.sigN; 
    378                 if( idx ) 
     379                if( idx > 0 ) 
    379380                    SET_BIT_BLOCK( idx ) 
    380381                it -= CC_LEN_FUNC; 
  • trunk/thune/gl/gx_atoms.h

    r506 r508  
    11// This file is automatically generated - do not edit. 
    22 
    3 #define UR_ATOM_DRAW_LIST_OPCODES               326 
    4 #define UR_ATOM_WIDTH           327 
    5 #define UR_ATOM_HEIGHT          328 
    6 #define UR_ATOM_AREA            329 
    7 #define UR_ATOM_RECT            330 
    8 #define UR_ATOM_RASTER          331 
    9 #define UR_ATOM_TEXTURE         332 
    10 #define UR_ATOM_ELEM            333 
     3#define UR_ATOM_DRAW_LIST_OPCODES               323 
     4#define UR_ATOM_WIDTH           324 
     5#define UR_ATOM_HEIGHT          325 
     6#define UR_ATOM_AREA            326 
     7#define UR_ATOM_RECT            327 
     8#define UR_ATOM_RASTER          328 
     9#define UR_ATOM_TEXTURE         329 
     10#define UR_ATOM_ELEM            330 
    1111#define UR_ATOM_CLOSE           184 
    12 #define UR_ATOM_FOCUS           334 
    13 #define UR_ATOM_RESIZE          335 
    14 #define UR_ATOM_KEY_DOWN                336 
    15 #define UR_ATOM_KEY_UP          337 
    16 #define UR_ATOM_MOUSE_MOVE              338 
    17 #define UR_ATOM_MOUSE_UP                339 
    18 #define UR_ATOM_MOUSE_DOWN              340 
    19 #define UR_ATOM_MOUSE_WHEEL             341 
    20 #define UR_ATOM_AMBIENT         342 
    21 #define UR_ATOM_DIFFUSE         343 
    22 #define UR_ATOM_SPECULAR                344 
    23 #define UR_ATOM_POS             345 
    24 #define UR_ATOM_SHADER          346 
    25 #define UR_ATOM_VERTEX          347 
    26 #define UR_ATOM_FRAGMENT                348 
    27 #define UR_ATOM_DEFAULT         349 
     12#define UR_ATOM_FOCUS           331 
     13#define UR_ATOM_RESIZE          332 
     14#define UR_ATOM_KEY_DOWN                333 
     15#define UR_ATOM_KEY_UP          334 
     16#define UR_ATOM_MOUSE_MOVE              335 
     17#define UR_ATOM_MOUSE_UP                336 
     18#define UR_ATOM_MOUSE_DOWN              337 
     19#define UR_ATOM_MOUSE_WHEEL             338 
     20#define UR_ATOM_AMBIENT         339 
     21#define UR_ATOM_DIFFUSE         340 
     22#define UR_ATOM_SPECULAR                341 
     23#define UR_ATOM_POS             342 
     24#define UR_ATOM_SHADER          343 
     25#define UR_ATOM_VERTEX          344 
     26#define UR_ATOM_FRAGMENT                345 
     27#define UR_ATOM_DEFAULT         346 
    2828#define UR_ATOM_WAIT            135 
    29 #define UR_ATOM_RGB             350 
    30 #define UR_ATOM_RGBA            351 
    31 #define UR_ATOM_DEPTH           352 
    32 #define UR_ATOM_CLAMP           353 
    33 #define UR_ATOM_REPEAT          354 
    34 #define UR_ATOM_NEAREST         355 
    35 #define UR_ATOM_LINEAR          356 
    36 #define UR_ATOM_MIN             357 
    37 #define UR_ATOM_MAG             358 
    38 #define UR_ATOM_MIPMAP          359 
    39 #define UR_ATOM_GRAY            360 
    40 #define UR_ATOM_RGB             350 
    41 #define UR_ATOM_RGBA            351 
     29#define UR_ATOM_RGB             347 
     30#define UR_ATOM_RGBA            348 
     31#define UR_ATOM_DEPTH           349 
     32#define UR_ATOM_CLAMP           350 
     33#define UR_ATOM_REPEAT          351 
     34#define UR_ATOM_NEAREST         352 
     35#define UR_ATOM_LINEAR          353 
     36#define UR_ATOM_MIN             354 
     37#define UR_ATOM_MAG             355 
     38#define UR_ATOM_MIPMAP          356 
     39#define UR_ATOM_GRAY            357 
     40#define UR_ATOM_RGB             347 
     41#define UR_ATOM_RGBA            348 
    4242#define UR_ATOM_ON              267 
    4343#define UR_ATOM_OFF             269 
    4444#define UR_ATOM_ADD             203 
    45 #define UR_ATOM_BURN            361 
    46 #define UR_ATOM_COLOR           362 
    47 #define UR_ATOM_TRANS           363 
    48 #define UR_ATOM_SPRITE          364 
    49 #define UR_ATOM_ONCE            365 
    50 #define UR_ATOM_PING_PONG               366 
    51 #define UR_ATOM_PONG            367 
     45#define UR_ATOM_BURN            358 
     46#define UR_ATOM_COLOR           359 
     47#define UR_ATOM_TRANS           360 
     48#define UR_ATOM_SPRITE          361 
     49#define UR_ATOM_ONCE            362 
     50#define UR_ATOM_PING_PONG               363 
     51#define UR_ATOM_PONG            364 
  • trunk/thune/make.c

    r494 r508  
    7979 
    8080#ifdef GC_STRESS_TEST 
    81     if( ut->flags & UR_ENV_GC ) 
     81    if( ut->flags & UR_THREAD_GC ) 
    8282        ur_recycle( ut ); 
    8383#endif 
     
    9090 
    9191#ifndef GC_STRESS_TEST 
    92     if( (ca->used == ca->avail) && (ut->flags & UR_ENV_GC) ) 
     92    if( (ca->used == ca->avail) && (ut->flags & UR_THREAD_GC) ) 
    9393    { 
    9494        ur_recycle( ut ); 
     
    121121 
    122122#ifdef GC_STRESS_TEST 
    123     if( ut->flags & UR_ENV_GC ) 
     123    if( ut->flags & UR_THREAD_GC ) 
    124124        ur_recycle( ut ); 
    125125#endif 
     
    132132 
    133133#ifndef GC_STRESS_TEST 
    134     if( (ca->used == ca->avail) && (ut->flags & UR_ENV_GC) ) 
     134    if( (ca->used == ca->avail) && (ut->flags & UR_THREAD_GC) ) 
    135135    { 
    136136        ur_recycle( ut ); 
     
    247247 
    248248#ifdef GC_STRESS_TEST 
    249     if( ut->flags & UR_ENV_GC ) 
     249    if( ut->flags & UR_THREAD_GC ) 
    250250        ur_recycle( ut ); 
    251251#endif 
     
    268268 
    269269#ifndef GC_STRESS_TEST 
    270     if( (ca->used == ca->avail) && (ut->flags & UR_ENV_GC) ) 
     270    if( (ca->used == ca->avail) && (ut->flags & UR_THREAD_GC) ) 
    271271    { 
    272272        ur_recycle( ut ); 
     
    300300 
    301301#ifdef GC_STRESS_TEST 
    302     if( ut->flags & UR_ENV_GC ) 
     302    if( ut->flags & UR_THREAD_GC ) 
    303303        ur_recycle( ut ); 
    304304#endif 
     
    312312 
    313313#ifndef GC_STRESS_TEST 
    314     if( (ca->used == ca->avail) && (ut->flags & UR_ENV_GC) ) 
     314    if( (ca->used == ca->avail) && (ut->flags & UR_THREAD_GC) ) 
    315315    { 
    316316        ur_recycle( ut ); 
  • trunk/thune/print.c

    r469 r508  
    284284    else if( braceType == UT_PAREN ) 
    285285        append1( '(', out ); 
    286 #ifdef UR_CONFIG_MARCOS 
     286#ifdef UR_CONFIG_MACROS 
    287287    else if( braceType == UT_MACRO ) 
    288         append1( '<', out ); 
     288    { 
     289        append( out, "^(", 2 ); 
     290        braceType = UT_PAREN; 
     291    } 
    289292#endif 
    290293 
     
    319322    else if( braceType == UT_PAREN ) 
    320323        append1( ')', out ); 
    321 #ifdef UR_CONFIG_MARCOS 
    322     else if( braceType == UT_MACRO ) 
    323         append1( '>', out ); 
    324 #endif 
    325324} 
    326325 
     
    11841183            break; 
    11851184 
     1185        case UT_BLOCK: 
    11861186        case UT_PAREN: 
    1187         case UT_BLOCK: 
     1187        case UT_MACRO: 
    11881188            if( val->id.flags & UR_FLAG_PRINT_RECURSION ) 
    11891189            { 
  • trunk/thune/series.c

    r488 r508  
    23072307    if( len > 0 ) 
    23082308    { 
     2309        orig = ur_bin(val);     // Re-acquire 
    23092310        memCpy( copy->ptr.b, 
    23102311                orig->ptr.b + (val->series.it * elemSize), 
  • trunk/thune/thread.c

    r499 r508  
    8383 
    8484        ur_pushContext( ut, (UCell*) &ur_thrGlobal ); 
     85 
     86        ut->flags = UR_THREAD_GC; 
    8587    } 
    8688    return ut; 
     
    309311    if( which == (blk->used - 1) ) 
    310312    { 
    311         while( (cell != blk->ptr.cells) && ur_is(cell, UT_UNSET) ) 
     313        UCell* stop = blk->ptr.cells - 1; 
     314        do 
    312315            --cell; 
    313         blk->used = cell - blk->ptr.cells;; 
     316        while( (cell != stop) && ur_is(cell, UT_UNSET) ); 
     317        blk->used = cell - blk->ptr.cells + 1; 
    314318    } 
    315319} 
  • trunk/thune/tokenize.c

    r491 r508  
    429429                    cell = ur_appendCell( BLOCK, mode ); 
    430430                    ur_setSeries( cell, STACK[ stack.used ], 0 ); 
    431  
    432431                    ++stack.used; 
     432 
    433433                    if( sol ) 
    434434                    { 
  • trunk/thune/urlan.c

    r501 r508  
    528528#endif 
    529529 
    530     env->flags = UR_ENV_GC | UR_ENV_SECURE; 
     530    env->flags = UR_ENV_SECURE; 
    531531 
    532532#if 0 
     
    681681    // Make a fresh thread store. 
    682682 
     683    ut->flags &= ~UR_THREAD_GC; 
    683684    ur_threadInitStore( ut, binCount, blkCount ); 
    684685 
     
    695696 
    696697    ur_makeBinary( 0, 0 );       // 0 - BIN_THREAD_TMP 
     698    ut->flags |= UR_THREAD_GC; 
    697699} 
    698700 
  • trunk/thune/urlan.h

    r499 r508  
    421421 
    422422 
    423 #define UR_ENV_GC           0x01 
     423#define UR_THREAD_GC        0x01 
    424424#define UR_ENV_SECURE       0x02 
    425425