1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoid

extra calls to is_pointer_to_heap() in GC.

* enum.c (enum_zip): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-06-13 04:02:36 +00:00
parent 283826f751
commit 97c8c1fa0e
3 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,10 @@
Fri Jun 13 12:55:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoid
extra calls to is_pointer_to_heap() in GC.
* enum.c (enum_zip): ditto.
Fri Jun 13 00:41:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_thread.rb: add a test.

6
enum.c
View file

@ -691,7 +691,8 @@ sort_by_i(VALUE i, VALUE ary, int argc, VALUE *argv)
if (RBASIC(ary)->klass) {
rb_raise(rb_eRuntimeError, "sort_by reentered");
}
memo = rb_node_newnode(NODE_MEMO, rb_yield(i), i, 0);
/* use NODE_DOT2 as memo(v, v, -) */
memo = rb_node_newnode(NODE_DOT2, rb_yield(i), i, 0);
rb_ary_push(ary, (VALUE)memo);
return Qnil;
}
@ -1574,7 +1575,8 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
if (!rb_block_given_p()) {
result = rb_ary_new();
}
memo = rb_node_newnode(NODE_MEMO, result, rb_ary_new4(argc, argv), 0);
/* use NODE_DOT2 as memo(v, v, -) */
memo = rb_node_newnode(NODE_DOT2, result, rb_ary_new4(argc, argv), 0);
rb_block_call(obj, id_each, 0, 0, allary ? zip_ary : zip_i, (VALUE)memo);
return result;

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2008-06-12"
#define RUBY_RELEASE_DATE "2008-06-13"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080612
#define RUBY_RELEASE_CODE 20080613
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 6
#define RUBY_RELEASE_DAY 12
#define RUBY_RELEASE_DAY 13
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];