mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (rb_ary_product): Use tmpary instead, to ensure marking
arrays by GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
006f384f8e
commit
bcfcbefc26
2 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Fri May 28 17:34:48 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||||
|
|
||||||
|
* array.c (rb_ary_product): Ensure arrays to be marked by GC.
|
||||||
|
|
||||||
Fri May 28 10:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri May 28 10:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mkmf.rb (checking_for): ignore toplevel.
|
* lib/mkmf.rb (checking_for): ignore toplevel.
|
||||||
|
|
4
array.c
4
array.c
|
@ -3683,9 +3683,9 @@ rb_ary_product(argc, argv, ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
int n = argc+1; /* How many arrays we're operating on */
|
int n = argc+1; /* How many arrays we're operating on */
|
||||||
volatile VALUE t0 = tmpbuf(n, sizeof(VALUE));
|
volatile VALUE t0 = ary_new(0, n);
|
||||||
volatile VALUE t1 = tmpbuf(n, sizeof(int));
|
volatile VALUE t1 = tmpbuf(n, sizeof(int));
|
||||||
VALUE *arrays = (VALUE*)RSTRING(t0)->ptr; /* The arrays we're computing the product of */
|
VALUE *arrays = RARRAY(t0)->ptr; /* The arrays we're computing the product of */
|
||||||
int *counters = (int*)RSTRING(t1)->ptr; /* The current position in each one */
|
int *counters = (int*)RSTRING(t1)->ptr; /* The current position in each one */
|
||||||
VALUE result; /* The array we'll be returning */
|
VALUE result; /* The array we'll be returning */
|
||||||
long i,j;
|
long i,j;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue