diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-29 07:24:55 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-29 07:24:55 +0900 |
| commit | 5077f9ec8bca9bc5d8c2802d89290415ec1baea0 (patch) | |
| tree | 82f7c5549c1876e4c27c4722de49ffc3a563db33 | |
| parent | 5c68195c88ed45164373b0ca435a7be2421dcc7c (diff) | |
| download | mruby-5077f9ec8bca9bc5d8c2802d89290415ec1baea0.tar.gz mruby-5077f9ec8bca9bc5d8c2802d89290415ec1baea0.zip | |
move mrb_shared_string definition to src/string.c
| -rw-r--r-- | include/mruby/string.h | 10 | ||||
| -rw-r--r-- | src/string.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/mruby/string.h b/include/mruby/string.h index a1b38d039..3ae427953 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -15,18 +15,12 @@ extern "C" { extern const char mrb_digitmap[]; -typedef struct mrb_shared_string { - int refcnt; - char *ptr; - mrb_int len; -} mrb_shared_string; - struct RString { MRB_OBJECT_HEADER; mrb_int len; union { mrb_int capa; - mrb_shared_string *shared; + struct mrb_shared_string *shared; } aux; char *ptr; }; @@ -40,7 +34,7 @@ struct RString { #define MRB_STR_SHARED 1 #define MRB_STR_STATIC (1<<1) -void mrb_str_decref(mrb_state*, mrb_shared_string*); +void mrb_str_decref(mrb_state*, struct mrb_shared_string*); void mrb_str_modify(mrb_state*, struct RString*); mrb_value mrb_str_literal(mrb_state*, mrb_value); void mrb_str_concat(mrb_state*, mrb_value, mrb_value); diff --git a/src/string.c b/src/string.c index 34769222a..c5e1b1534 100644 --- a/src/string.c +++ b/src/string.c @@ -23,6 +23,12 @@ const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +typedef struct mrb_shared_string { + int refcnt; + char *ptr; + mrb_int len; +} mrb_shared_string; + static mrb_value str_replace(mrb_state *mrb, struct RString *s1, struct RString *s2); static mrb_value mrb_str_subseq(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len); |
