29 lines
843 B
C++
29 lines
843 B
C++
|
INLINE CELL string_capacity(F_STRING *str)
|
||
|
{
|
||
|
return untag_fixnum_fast(str->length);
|
||
|
}
|
||
|
|
||
|
INLINE CELL string_size(CELL size)
|
||
|
{
|
||
|
return sizeof(F_STRING) + size;
|
||
|
}
|
||
|
|
||
|
#define BREF(byte_array,index) ((CELL)byte_array + sizeof(F_BYTE_ARRAY) + (index))
|
||
|
#define SREF(string,index) ((CELL)string + sizeof(F_STRING) + (index))
|
||
|
|
||
|
DEFINE_UNTAG(F_STRING,STRING_TYPE,string)
|
||
|
|
||
|
F_STRING* allot_string_internal(CELL capacity);
|
||
|
F_STRING* allot_string(CELL capacity, CELL fill);
|
||
|
void primitive_string(void);
|
||
|
F_STRING *reallot_string(F_STRING *string, CELL capacity);
|
||
|
void primitive_resize_string(void);
|
||
|
|
||
|
/* String getters and setters */
|
||
|
CELL string_nth(F_STRING* string, CELL index);
|
||
|
void set_string_nth(F_STRING* string, CELL index, CELL value);
|
||
|
|
||
|
void primitive_string_nth(void);
|
||
|
void primitive_set_string_nth_slow(void);
|
||
|
void primitive_set_string_nth_fast(void);
|