Changeset 26 for trunk/orca/bytecode.c

Show
Ignore:
Timestamp:
02/07/06 00:52:42 (3 years ago)
Author:
krobillard
Message:

Atom names are now stored in a single string.
Maximum word length is now 32.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/bytecode.c

    r25 r26  
    5555        case OT_REFINEMENT: 
    5656        { 
    57             int len; 
     57            int pos; 
    5858            int atom; 
    59             OString* str; 
    6059 
    6160            atom = (val->type == OT_REFINEMENT) ? val->index : val->word.atom; 
    62  
    63             str = orAtomString( atom ); 
    64  
    65             // LIMIT: Assuming word names are never more than 255 characters. 
    66  
    67             len = str->used + 2; 
    68             RESERVE( len ); 
     61            pos = bin->used; 
     62 
     63            orArrayReserve( bin, 1, bin->used + 2 ); 
     64            bin->used += 2; 
     65 
     66            orAtomStr( atom, bin ); 
     67 
     68            // LIMIT: Word names can never be more than 255 characters. 
     69            cp = bin->byteArray + pos; 
    6970            *cp++ = val->type; 
    70             *cp++ = str->used; 
    71  
    72             memCpy( cp, str->charArray, str->used ); 
     71            *cp   = bin->used - pos - 2; 
    7372        } 
    7473            break;