From 9699fdb1bd639182e38d718c9d5753068179a769 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 20 May 2016 10:48:51 +0000 Subject: exclude non-VALUE in memo from GC * internal.h (NEW_PARTIAL_MEMO_FOR): shrink buffer array not to mark non-VALUE fields. fix check_rvalue_consistency abort with RGENGC_CHECK_MODE=2. * internal.h (NEW_CMP_OPT_MEMO): exclude struct cmp_opt_data from the valid array range. * enum.c (slicewhen_i): exclude inverted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index fd6113accb..b62f7c3f37 100644 --- a/enum.c +++ b/enum.c @@ -1563,7 +1563,7 @@ static VALUE enum_min(int argc, VALUE *argv, VALUE obj) { VALUE memo; - struct min_t *m = NEW_MEMO_FOR(struct min_t, memo); + struct min_t *m = NEW_CMP_OPT_MEMO(struct min_t, memo); VALUE result; VALUE num; @@ -1656,7 +1656,7 @@ static VALUE enum_max(int argc, VALUE *argv, VALUE obj) { VALUE memo; - struct max_t *m = NEW_MEMO_FOR(struct max_t, memo); + struct max_t *m = NEW_CMP_OPT_MEMO(struct max_t, memo); VALUE result; VALUE num; @@ -1809,7 +1809,7 @@ static VALUE enum_minmax(VALUE obj) { VALUE memo; - struct minmax_t *m = NEW_MEMO_FOR(struct minmax_t, memo); + struct minmax_t *m = NEW_CMP_OPT_MEMO(struct minmax_t, memo); m->min = Qundef; m->last = Qundef; @@ -3406,7 +3406,8 @@ slicewhen_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator)) { VALUE enumerable; VALUE arg; - struct slicewhen_arg *memo = NEW_MEMO_FOR(struct slicewhen_arg, arg); + struct slicewhen_arg *memo = + NEW_PARTIAL_MEMO_FOR(struct slicewhen_arg, arg, inverted); enumerable = rb_ivar_get(enumerator, rb_intern("slicewhen_enum")); memo->pred = rb_attr_get(enumerator, rb_intern("slicewhen_pred")); -- cgit v1.2.3