summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2021-11-05 09:51:53 -0400
committerPeter Zhu <peter@peterzhu.ca>2021-11-08 14:05:54 -0500
commitaeae6e2842e1702dfb89b8ae69b48c4f5f64c662 (patch)
tree33a7c7e23bf109123a77c7eb644e66e9bd44d75d /ext
parentaa5bccfc65cf47a10d72cefa4bc2ee097f135b4c (diff)
[Feature #18290] Remove all usages of rb_gc_force_recycle
This commit removes usages of rb_gc_force_recycle since it is a burden to maintain and makes changes to the GC difficult.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4363
Diffstat (limited to 'ext')
-rw-r--r--ext/readline/readline.c1
-rw-r--r--ext/zlib/zlib.c4
2 files changed, 0 insertions, 5 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 8d635fce89..5ae037dd41 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -696,7 +696,6 @@ str_subpos(const char *ptr, const char *end, long beg, long *sublen, rb_encoding
VALUE str = rb_enc_str_new_static(ptr, end-ptr, enc);
OBJ_FREEZE(str);
ptr = rb_str_subpos(str, beg, sublen);
- rb_gc_force_recycle(str);
return ptr;
}
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 9937f82740..9bf71ce80e 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -894,7 +894,6 @@ zstream_discard_input(struct zstream *z, long len)
}
rb_str_resize(z->input, newlen);
if (newlen == 0) {
- rb_gc_force_recycle(z->input);
z->input = Qnil;
}
else {
@@ -1137,7 +1136,6 @@ loop:
}
if (!NIL_P(old_input)) {
rb_str_resize(old_input, 0);
- rb_gc_force_recycle(old_input);
}
if (args.jump_state)
@@ -2906,8 +2904,6 @@ gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
if (!NIL_P(outbuf)) {
rb_str_resize(outbuf, RSTRING_LEN(dst));
memcpy(RSTRING_PTR(outbuf), RSTRING_PTR(dst), RSTRING_LEN(dst));
- rb_str_resize(dst, 0);
- rb_gc_force_recycle(dst);
dst = outbuf;
}
return dst;