[前][次][番号順一覧][スレッド一覧]

ruby-changes:37931

From: ko1 <ko1@a...>
Date: Thu, 19 Mar 2015 04:47:59 +0900 (JST)
Subject: [ruby-changes:37931] ko1:r50012 (trunk): * enum.c (enum_sort_by): add WBs.

ko1	2015-03-19 04:47:36 +0900 (Thu, 19 Mar 2015)

  New Revision: 50012

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50012

  Log:
    * enum.c (enum_sort_by): add WBs.

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50011)
+++ ChangeLog	(revision 50012)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 19 04:46:36 2015  Koichi Sasada  <ko1@a...>
+
+	* enum.c (enum_sort_by): add WBs.
+
 Thu Mar 19 03:37:52 2015  Koichi Sasada  <ko1@a...>
 
 	* gc.c (check_rvalue_consistency): refactoring.
Index: enum.c
===================================================================
--- enum.c	(revision 50011)
+++ enum.c	(revision 50012)
@@ -846,8 +846,8 @@ enum_sort(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L846
 
 #define SORT_BY_BUFSIZE 16
 struct sort_by_data {
-    VALUE ary;
-    VALUE buf;
+    const VALUE ary;
+    const VALUE buf;
     long n;
 };
 
@@ -989,8 +989,8 @@ enum_sort_by(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L989
     memo = MEMO_NEW(0, 0, 0);
     OBJ_INFECT(memo, obj);
     data = (struct sort_by_data *)&memo->v1;
-    data->ary = ary;
-    data->buf = buf;
+    RB_OBJ_WRITE(memo, &data->ary, ary);
+    RB_OBJ_WRITE(memo, &data->buf, buf);
     data->n = 0;
     rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
     ary = data->ary;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]