ruby-changes:9200
From: mame <ko1@a...>
Date: Sun, 14 Dec 2008 14:56:12 +0900 (JST)
Subject: [ruby-changes:9200] Ruby:r20737 (trunk): * bignum.c (bigmul1_balance, bigmul1_karatsuba): remove all
mame 2008-12-14 14:55:54 +0900 (Sun, 14 Dec 2008) New Revision: 20737 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20737 Log: * bignum.c (bigmul1_balance, bigmul1_karatsuba): remove all rb_gc_force_recycle which causes memory leak. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 20736) +++ ChangeLog (revision 20737) @@ -1,3 +1,8 @@ +Sun Dec 14 14:53:41 2008 Yusuke Endoh <mame@t...> + + * bignum.c (bigmul1_balance, bigmul1_karatsuba): remove all + rb_gc_force_recycle which causes memory leak. + Sun Dec 14 14:26:11 2008 Yuki Sonoda (Yugui) <yugui@y...> * spec/README: directory structrue changed Index: bignum.c =================================================================== --- bignum.c (revision 20736) +++ bignum.c (revision 20737) @@ -1617,7 +1617,6 @@ yn -= r; n += r; } - rb_gc_force_recycle(t1); return z; } @@ -1698,7 +1697,6 @@ /* subtract t2 from middle bytes of the result (z1) */ i = xn + yn - n; bigsub_core(zds + n, i, BDIGITS(t2), t2n, zds + n, i); - rb_gc_force_recycle(t2); } else { /* copy 0 into low bytes of the result (z0) */ @@ -1708,26 +1706,18 @@ /* subtract t1 from middle bytes of the result (z1) */ i = xn + yn - n; bigsub_core(zds + n, i, BDIGITS(t1), t1n, zds + n, i); - rb_gc_force_recycle(t1); /* t1 <- xh + xl */ t1 = bigadd(xh, xl, 1); - if (xh != yh) rb_gc_force_recycle(xh); - if (xl != yl) rb_gc_force_recycle(xl); /* t2 <- yh + yl */ t2 = (x == y) ? t1 : bigadd(yh, yl, 1); - rb_gc_force_recycle(yh); - rb_gc_force_recycle(yl); /* t3 <- t1 * t2 */ t3 = bigmul0(t1, t2); - rb_gc_force_recycle(t1); - if (t1 != t2) rb_gc_force_recycle(t2); /* add t3 to middle bytes of the result (z1) */ bigadd_core(zds + n, i, BDIGITS(t3), big_real_len(t3), zds + n, i); - rb_gc_force_recycle(t3); return z; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/