Commit 058bb18f authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1828 from take-cheeze/string_embed

Use sizeof(void*) instead of mrb_int size and extend embed string size.
parents 286665c4 c3f3a048
......@@ -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*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment