embed small string

use flags 4 for *this object is embed*
use flags 8~64 for *embed string length*
This commit is contained in:
ksss
2014-03-02 11:04:04 +00:00
parent e40428af7b
commit 4070b5987a
11 changed files with 210 additions and 181 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
struct RString *s = mrb_str_ptr(str);
mrb_str_modify(mrb, s);
p = s->ptr;
pend = s->ptr + s->len;
p = s->as.heap.ptr;
pend = s->as.heap.ptr + s->as.heap.len;
while (p < pend) {
if (ISUPPER(*p)) {
*p = TOLOWER(*p);