From 1da2e7fca35dc697d85dd91d2572ab58d08cd3bc Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 4 Apr 2023 17:30:06 -0400 Subject: [Feature #19579] Remove !USE_RVARGC code (#7655) Remove !USE_RVARGC code [Feature #19579] The Variable Width Allocation feature was turned on by default in Ruby 3.2. Since then, we haven't received bug reports or backports to the non-Variable Width Allocation code paths, so we assume that nobody is using it. We also don't plan on maintaining the non-Variable Width Allocation code, so we are going to remove it. --- ext/-test-/string/cstr.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'ext') diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c index 468ee7a3b1..ecca793145 100644 --- a/ext/-test-/string/cstr.c +++ b/ext/-test-/string/cstr.c @@ -62,12 +62,7 @@ bug_str_unterminated_substring(VALUE str, VALUE vbeg, VALUE vlen) if (RSTRING_LEN(str) < beg + len) rb_raise(rb_eIndexError, "end: %ld", beg + len); str = rb_str_new_shared(str); if (STR_EMBED_P(str)) { -#if USE_RVARGC RSTRING(str)->as.embed.len = (short)len; -#else - RSTRING(str)->basic.flags &= ~RSTRING_EMBED_LEN_MASK; - RSTRING(str)->basic.flags |= len << RSTRING_EMBED_LEN_SHIFT; -#endif memmove(RSTRING(str)->as.embed.ary, RSTRING(str)->as.embed.ary + beg, len); } else { @@ -116,11 +111,7 @@ bug_str_s_cstr_noembed(VALUE self, VALUE str) Check_Type(str, T_STRING); FL_SET((str2), STR_NOEMBED); memcpy(buf, RSTRING_PTR(str), capacity); -#if USE_RVARGC RBASIC(str2)->flags &= ~(STR_SHARED | FL_USER5 | FL_USER6); -#else - RBASIC(str2)->flags &= ~RSTRING_EMBED_LEN_MASK; -#endif RSTRING(str2)->as.heap.aux.capa = capacity; RSTRING(str2)->as.heap.ptr = buf; RSTRING(str2)->as.heap.len = RSTRING_LEN(str); -- cgit v1.2.1