]> gitweb.factorcode.org Git - factor.git/blob - vmpp/strings.hpp
Remove cruddy string encoding/decoding code from VM
[factor.git] / vmpp / strings.hpp
1 INLINE CELL string_capacity(F_STRING *str)
2 {
3         return untag_fixnum_fast(str->length);
4 }
5
6 INLINE CELL string_size(CELL size)
7 {
8         return sizeof(F_STRING) + size;
9 }
10
11 #define BREF(byte_array,index) ((CELL)byte_array + sizeof(F_BYTE_ARRAY) + (index))
12 #define SREF(string,index) ((CELL)string + sizeof(F_STRING) + (index))
13
14 DEFINE_UNTAG(F_STRING,STRING_TYPE,string)
15
16 F_STRING* allot_string_internal(CELL capacity);
17 F_STRING* allot_string(CELL capacity, CELL fill);
18 void primitive_string(void);
19 F_STRING *reallot_string(F_STRING *string, CELL capacity);
20 void primitive_resize_string(void);
21
22 /* String getters and setters */
23 CELL string_nth(F_STRING* string, CELL index);
24 void set_string_nth(F_STRING* string, CELL index, CELL value);
25
26 void primitive_string_nth(void);
27 void primitive_set_string_nth_slow(void);
28 void primitive_set_string_nth_fast(void);