rename API mrb_str_dup_static() -> mrb_str_pool()

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-11-20 08:37:16 +09:00
parent 217595c325
commit fb386011df
5 changed files with 25 additions and 25 deletions
-22
View File
@@ -734,28 +734,6 @@ mrb_str_dup(mrb_state *mrb, mrb_value str)
return mrb_str_new(mrb, s->ptr, s->len);
}
mrb_value
mrb_str_dup_static(mrb_state *mrb, mrb_value str)
{
struct RString *s = mrb_str_ptr(str);
struct RString *ns;
mrb_int len;
ns = (struct RString *)mrb_malloc(mrb, sizeof(struct RString));
ns->tt = MRB_TT_STRING;
ns->c = mrb->string_class;
len = s->len;
ns->len = len;
ns->ptr = (char *)mrb_malloc(mrb, (size_t)len+1);
if (s->ptr) {
memcpy(ns->ptr, s->ptr, len);
}
ns->ptr[len] = '\0';
return mrb_obj_value(ns);
}
static mrb_value
mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx)
{