From cbd8b099200d9cd19df770dbabeb698b08135800 Mon Sep 17 00:00:00 2001 From: tmm1 Date: Wed, 17 Apr 2013 11:20:23 +0000 Subject: iseq: reduce array allocations for simple sequences * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object(). * insns.def (setinlinecache): Ditto. * iseq.c (rb_iseq_add_mark_object): New function to allocate iseq->mark_ary on demand. [Bug #8142] * iseq.h (rb_iseq_add_mark_object): Ditto. * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed. * iseq.c (rb_iseq_build_for_ruby2cext): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 1f5915cd0d..c9b59b275b 100644 --- a/compile.c +++ b/compile.c @@ -416,7 +416,7 @@ static int iseq_add_mark_object(rb_iseq_t *iseq, VALUE v) { if (!SPECIAL_CONST_P(v)) { - rb_ary_push(iseq->mark_ary, v); + rb_iseq_add_mark_object(iseq, v); } return COMPILE_OK; } -- cgit v1.2.3