avoid copying when the original string comes with MRB_STR_NOFREE

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-12-25 10:30:48 +09:00
parent 9b7b18aaf4
commit 673d9183cf
3 changed files with 16 additions and 9 deletions
+3
View File
@@ -32,6 +32,9 @@ struct RString {
#define RSTRING_CAPA(s) (RSTRING(s)->aux.capa)
#define RSTRING_END(s) (RSTRING(s)->ptr + RSTRING(s)->len)
#define MRB_STR_SHARED 1
#define MRB_STR_NOFREE 2
void mrb_gc_free_str(mrb_state*, struct RString*);
void mrb_str_modify(mrb_state*, struct RString*);
mrb_value mrb_str_literal(mrb_state*, mrb_value);