[#37050] [Feature #735] Date#inspect — "rubikitch ." <redmine@...>

Feature #735: Date#inspect

14 messages 2008/11/09

[#37075] [Feature #747] /\A/u ignores BOM — Shyouhei Urabe <redmine@...>

Feature #747: /\A/u ignores BOM

14 messages 2008/11/12

[#37161] m17n of irb — "Yugui (Yuki Sonoda)" <yugui@...>

Yuguiです。

35 messages 2008/11/24
[#37183] Re: m17n of irb — keiju@... (keiju ISHITSUKA) 2008/11/25

けいじゅ@いしつかです.

[#37203] Re: m17n of irb — "Yugui (Yuki Sonoda)" <yugui@...> 2008/11/26

keiju ISHITSUKA さんは書きました:

[#37292] Re: m17n of irb — Yukihiro Matsumoto <matz@...> 2008/12/06

まつもと ゆきひろです

[#37293] Re: m17n of irb — "Yugui (Yuki Sonoda)" <yugui@...> 2008/12/07

Yuguiです。

[#37298] Re: m17n of irb — Yukihiro Matsumoto <matz@...> 2008/12/07

まつもと ゆきひろです

[#37210] RSS::Maker.create(version) — "Akinori MUSHA" <knu@...>

 RSS::Maker で、 "2.0" 等の文字列でフィードのフォーマットを渡す

15 messages 2008/11/27

[#37213] Re: [ruby-cvs:27586] Ruby:r20368 (trunk): * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should return — Tadayoshi Funaba <tadf@...>

> * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should return

8 messages 2008/11/27

[ruby-dev:37184] Re: [Bug:1.8] RSTRING in ext/gdbm/gdbm.c

From: Kazuhiro NISHIYAMA <zn@...>
Date: 2008-11-25 07:56:39 UTC
List: ruby-dev #37184
西山和広です。

先ほどのパッチではdptrがメモリリークするようになってしまっていたので、
修正しました。

Index: ext/gdbm/gdbm.c
===================================================================
--- ext/gdbm/gdbm.c(revision 20353)
+++ ext/gdbm/gdbm.c(working copy)
@@ -303,14 +303,10 @@
     if (val.dptr == 0)
         return Qnil;
 
-    str = rb_obj_alloc(rb_cString);
-    RSTRING(str)->len = val.dsize;
-    RSTRING(str)->aux.capa = val.dsize;
-    RSTRING(str)->ptr = REALLOC_N(val.dptr,char,val.dsize+1);
-    RSTRING(str)->ptr[val.dsize] = '\0';
-
+    str = rb_str_new(val.dptr, val.dsize);
     OBJ_TAINT(str);
-    return (VALUE)str;
+    free(val.dptr);
+    return str;
 }
 
 static VALUE
@@ -349,13 +345,9 @@
     if (key.dptr == 0)
         return Qnil;
 
-    str = rb_obj_alloc(rb_cString);
-    RSTRING(str)->len = key.dsize;
-    RSTRING(str)->aux.capa = key.dsize;
-    RSTRING(str)->ptr = REALLOC_N(key.dptr,char,key.dsize+1);
-    RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
-
+    str = rb_str_new(key.dptr, key.dsize);
     OBJ_TAINT(str);
+    free(key.dptr);
     return str;
 }
 
@@ -373,13 +365,9 @@
     if (key2.dptr == 0)
         return Qnil;
 
-    str = rb_obj_alloc(rb_cString);
-    RSTRING(str)->len = key2.dsize;
-    RSTRING(str)->aux.capa = key2.dsize;
-    RSTRING(str)->ptr = REALLOC_N(key2.dptr,char,key2.dsize+1);
-    RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
-
+    str = rb_str_new(key2.dptr, key2.dsize);
     OBJ_TAINT(str);
+    free(key2.dptr);
     return str;
 }
 

-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)

In This Thread