diff options
| author | take_cheeze <[email protected]> | 2014-03-08 00:32:59 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2014-03-08 00:32:59 +0900 |
| commit | c3f3a0484a7700c97a6ebe9ee7101b1ebe6b7626 (patch) | |
| tree | fb510d267d44cb91bc156cb366dcc48e2476ad9a /include | |
| parent | aa4f3c79ef43133674151c1fd5e263ea34e93635 (diff) | |
| download | mruby-c3f3a0484a7700c97a6ebe9ee7101b1ebe6b7626.tar.gz mruby-c3f3a0484a7700c97a6ebe9ee7101b1ebe6b7626.zip | |
use sizeof(void*) instead of mrb_int size and extend embed string size
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/string.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/mruby/string.h b/include/mruby/string.h index 7e7fb13d9..9ccbae56c 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -15,14 +15,7 @@ extern "C" { extern const char mrb_digitmap[]; -/* (sizeof(mrb_int)*2+sizeof(char*))/sizeof(char)-1 */ -#if defined(MRB_INT16) -# define RSTRING_EMBED_LEN_MAX 9 -#elif defined(MRB_INT64) -# define RSTRING_EMBED_LEN_MAX 15 -#else -# define RSTRING_EMBED_LEN_MAX 11 -#endif +#define RSTRING_EMBED_LEN_MAX (sizeof(void*) * 3 - 1) struct RString { MRB_OBJECT_HEADER; @@ -58,7 +51,7 @@ struct RString { #define MRB_STR_SHARED 1 #define MRB_STR_NOFREE 2 #define MRB_STR_EMBED 4 -#define MRB_STR_EMBED_LEN_MASK 120 +#define MRB_STR_EMBED_LEN_MASK 0xf8 #define MRB_STR_EMBED_LEN_SHIFT 3 void mrb_gc_free_str(mrb_state*, struct RString*); |
