ruby-changes:2500
From: ko1@a...
Date: 21 Nov 2007 15:06:31 +0900
Subject: [ruby-changes:2500] ko1 - Ruby:r13991 (trunk): * array.c (rb_ary_permutation): add gc guard codes.
ko1 2007-11-21 15:06:10 +0900 (Wed, 21 Nov 2007)
New Revision: 13991
Modified files:
trunk/ChangeLog
trunk/array.c
Log:
* array.c (rb_ary_permutation): add gc guard codes.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?r1=13991&r2=13990
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13991&r2=13990
Index: array.c
===================================================================
--- array.c (revision 13990)
+++ array.c (revision 13991)
@@ -3047,15 +3047,17 @@
}
}
else { /* this is the general case */
- volatile VALUE t0 = tmpbuf(n,sizeof(long));
+ VALUE t0 = tmpbuf(n,sizeof(long));
long *p = (long*)RSTRING_PTR(t0);
- volatile VALUE t1 = tmpbuf(n,sizeof(int));
+ VALUE t1 = tmpbuf(n,sizeof(int));
int *used = (int*)RSTRING_PTR(t1);
VALUE ary0 = ary_make_shared(ary); /* private defensive copy of ary */
for (i = 0; i < n; i++) used[i] = 0; /* initialize array */
permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
+ RB_GC_GUARD(t0);
+ RB_GC_GUARD(t1);
}
return ary;
}
Index: ChangeLog
===================================================================
--- ChangeLog (revision 13990)
+++ ChangeLog (revision 13991)
@@ -1,3 +1,7 @@
+Wed Nov 21 14:55:13 2007 Koichi Sasada <ko1@a...>
+
+ * array.c (rb_ary_permutation): add gc guard codes.
+
Wed Nov 21 03:12:50 2007 Yukihiro Matsumoto <matz@r...>
* process.c (rb_f_system): returns nil on execution failure.
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml