diff options
Diffstat (limited to 'include/ruby/internal/core/rstring.h')
-rw-r--r-- | include/ruby/internal/core/rstring.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index e394ab7dca..777fe6dab1 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -42,11 +42,6 @@ /** @cond INTERNAL_MACRO */ #define RSTRING_NOEMBED RSTRING_NOEMBED -#if !USE_RVARGC -#define RSTRING_EMBED_LEN_MASK RSTRING_EMBED_LEN_MASK -#define RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT -#define RSTRING_EMBED_LEN_MAX RSTRING_EMBED_LEN_MAX -#endif #define RSTRING_FSTR RSTRING_FSTR #define RSTRING_EMBED_LEN RSTRING_EMBED_LEN #define RSTRING_LEN RSTRING_LEN @@ -162,21 +157,6 @@ enum ruby_rstring_flags { */ RSTRING_NOEMBED = RUBY_FL_USER1, -#if !USE_RVARGC - /** - * When a string employs embedded strategy (see ::RSTRING_NOEMBED), these - * bits are used to store the number of bytes actually filled into - * ::RString::ary. - * - * @internal - * - * 3rd parties must not be aware that there even is more than one way to - * store a string. Might better be hidden. - */ - RSTRING_EMBED_LEN_MASK = RUBY_FL_USER2 | RUBY_FL_USER3 | RUBY_FL_USER4 | - RUBY_FL_USER5 | RUBY_FL_USER6, -#endif - /* Actually, string encodings are also encoded into the flags, using * remaining bits.*/ @@ -202,20 +182,6 @@ enum ruby_rstring_flags { RSTRING_FSTR = RUBY_FL_USER17 }; -#if !USE_RVARGC -/** - * This is an enum because GDB wants it (rather than a macro). People need not - * bother. - */ -enum ruby_rstring_consts { - /** Where ::RSTRING_EMBED_LEN_MASK resides. */ - RSTRING_EMBED_LEN_SHIFT = RUBY_FL_USHIFT + 2, - - /** Max possible number of characters that can be embedded. */ - RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 -}; -#endif - /** * Ruby's String. A string in ruby conceptually has these information: * @@ -279,7 +245,6 @@ struct RString { /** Embedded contents. */ struct { -#if USE_RVARGC long len; /* This is a length 1 array because: * 1. GCC has a bug that does not optimize C flexible array members @@ -287,16 +252,6 @@ struct RString { * 2. Zero length arrays are not supported by all compilers */ char ary[1]; -#else - /** - * When a string is short enough, it uses this area to store the - * contents themselves. This was impractical in the 20th century, - * but these days 64 bit machines can typically hold 24 bytes here. - * Could be sufficiently large. In this case the length is encoded - * into the flags. - */ - char ary[RSTRING_EMBED_LEN_MAX + 1]; -#endif } embed; } as; }; @@ -425,15 +380,8 @@ RSTRING_EMBED_LEN(VALUE str) RBIMPL_ASSERT_TYPE(str, RUBY_T_STRING); RBIMPL_ASSERT_OR_ASSUME(! RB_FL_ANY_RAW(str, RSTRING_NOEMBED)); -#if USE_RVARGC long f = RSTRING(str)->as.embed.len; return f; -#else - VALUE f = RBASIC(str)->flags; - f &= RSTRING_EMBED_LEN_MASK; - f >>= RSTRING_EMBED_LEN_SHIFT; - return RBIMPL_CAST((long)f); -#endif } RBIMPL_WARNING_PUSH() |