summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-04-04 17:30:06 -0400
committerGitHub <noreply@github.com>2023-04-04 17:30:06 -0400
commit1da2e7fca35dc697d85dd91d2572ab58d08cd3bc (patch)
tree1583d534518f36da8678b4f048ed0eb5a5c00fa0 /ext
parent1190ec60cc3145c06cca6897b160b3e8ba2c7ecd (diff)
downloadruby-1da2e7fca35dc697d85dd91d2572ab58d08cd3bc.tar.gz
[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.
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/string/cstr.c9
1 files changed, 0 insertions, 9 deletions
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);