From aeae6e2842e1702dfb89b8ae69b48c4f5f64c662 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 5 Nov 2021 09:51:53 -0400 Subject: [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. --- ext/readline/readline.c | 1 - ext/zlib/zlib.c | 4 ---- 2 files changed, 5 deletions(-) (limited to 'ext') 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; -- cgit v1.2.3