Space one byte per string
parent
0311c0a842
commit
bc2ce8a77b
|
@ -248,7 +248,7 @@ M: wrapper '
|
|||
emit-seq ;
|
||||
|
||||
: pack-string ( string -- newstr )
|
||||
dup length 1+ bootstrap-cell align 0 pad-right ;
|
||||
dup length bootstrap-cell align 0 pad-right ;
|
||||
|
||||
: emit-string ( string -- ptr )
|
||||
string type-number object tag-number [
|
||||
|
|
|
@ -463,10 +463,6 @@ F_STRING* allot_string_internal(CELL capacity)
|
|||
{
|
||||
F_STRING *string = allot_object(STRING_TYPE,string_size(capacity));
|
||||
|
||||
/* strings are null-terminated in memory, even though they also
|
||||
have a length field. The null termination allows us to add
|
||||
the sizeof(F_STRING) to a Factor string to get a C-style
|
||||
char* string for C library calls. */
|
||||
string->length = tag_fixnum(capacity);
|
||||
string->hashcode = F;
|
||||
string->aux = F;
|
||||
|
|
|
@ -11,7 +11,7 @@ INLINE CELL string_capacity(F_STRING* str)
|
|||
|
||||
INLINE CELL string_size(CELL size)
|
||||
{
|
||||
return sizeof(F_STRING) + size + 1;
|
||||
return sizeof(F_STRING) + size;
|
||||
}
|
||||
|
||||
DEFINE_UNTAG(F_BYTE_ARRAY,BYTE_ARRAY_TYPE,byte_array)
|
||||
|
|
Loading…
Reference in New Issue