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

ruby-changes:16250

From: shyouhei <ko1@a...>
Date: Tue, 8 Jun 2010 16:49:29 +0900 (JST)
Subject: [ruby-changes:16250] Ruby:r28217 (ruby_1_8_7): merge revision(s) 27665:

shyouhei	2010-06-08 16:49:18 +0900 (Tue, 08 Jun 2010)

  New Revision: 28217

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

  Log:
    merge revision(s) 27665:
    * ext/bigdecimal/bigdecimal.c (VpAlloc): ensure buf does not get
      collected.  based on a patch masaya tarui at [ruby-dev:41213].

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/ext/bigdecimal/bigdecimal.c
    branches/ruby_1_8_7/version.h

Index: ruby_1_8_7/ext/bigdecimal/bigdecimal.c
===================================================================
--- ruby_1_8_7/ext/bigdecimal/bigdecimal.c	(revision 28216)
+++ ruby_1_8_7/ext/bigdecimal/bigdecimal.c	(revision 28217)
@@ -2506,7 +2506,7 @@
     int  sign=1;
     Real *vp = NULL;
     U_LONG mf = VpGetPrecLimit();
-    volatile VALUE buf;
+    VALUE buf;
 
     mx = (mx + BASE_FIG - 1) / BASE_FIG + 1;    /* Determine allocation unit. */
     if(szVal) {
@@ -2534,7 +2534,7 @@
 
     /* Skip all '_' after digit: 2006-6-30 */
     ni = 0;
-    buf = rb_str_new(0,strlen(szVal)+1);
+    buf = rb_str_tmp_new(strlen(szVal)+1);
     psz = RSTRING_PTR(buf);
     i   = 0;
     ipn = 0;
@@ -2633,6 +2633,7 @@
     vp->MaxPrec = mx;        /* set max precision */
     VpSetZero(vp,sign);
     VpCtoV(vp, &(szVal[ipn]), ni, &(szVal[ipf]), nf, &(szVal[ipe]), ne);
+    rb_str_resize(buf, 0);
     return vp;
 }
 
Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 28216)
+++ ruby_1_8_7/ChangeLog	(revision 28217)
@@ -1,3 +1,8 @@
+Tue Jun  8 16:42:48 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/bigdecimal/bigdecimal.c (VpAlloc): ensure buf does not get
+	  collected.  based on a patch masaya tarui at [ruby-dev:41213].
+
 Tue Jun  8 16:08:00 2010  Shugo Maeda  <shugo@r...>
 
 	* lib/net/imap.rb (fetch_internal): do not quote message data item
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 28216)
+++ ruby_1_8_7/version.h	(revision 28217)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2010-06-08"
 #define RUBY_VERSION_CODE 187
 #define RUBY_RELEASE_CODE 20100608
-#define RUBY_PATCHLEVEL 281
+#define RUBY_PATCHLEVEL 282
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8

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

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