cache UTF8 status for utf8_strlen(); ref #980

This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-02-04 23:33:16 +09:00
parent 5e514c910f
commit 25e4ec3f37
2 changed files with 11 additions and 3 deletions
+4 -3
View File
@@ -81,9 +81,10 @@ mrb_int mrb_str_strlen(mrb_state*, struct RString*);
#define MRB_STR_SHARED 1
#define MRB_STR_NOFREE 2
#define MRB_STR_FROZEN 4
#define MRB_STR_EMBED 8
#define MRB_STR_EMBED_LEN_MASK 0x1f0
#define MRB_STR_EMBED_LEN_SHIFT 4
#define MRB_STR_NO_UTF 8
#define MRB_STR_EMBED 16
#define MRB_STR_EMBED_LEN_MASK 0x3e0
#define MRB_STR_EMBED_LEN_SHIFT 5
void mrb_gc_free_str(mrb_state*, struct RString*);
MRB_API void mrb_str_modify(mrb_state*, struct RString*);