[#39845] Re: [ruby-cvs:33238] Ruby:r26022 (trunk): * marshal.c (w_object): dump instance variables when using — Tanaka Akira <akr@...>
2009/12/5 <nobu@ruby-lang.org>:
3 messages
2009/12/06
[#39846] [Bug #2447] reduce GC pressure by symbol table without String instance — Yusuke Endoh <redmine@...>
Bug #2447: reduce GC pressure by symbol table without String instance
5 messages
2009/12/06
[#39847] stable find.rb — Tanaka Akira <akr@...>
ディレクトリを再帰的にたどった結果を比較することがあったのですが、
5 messages
2009/12/06
[#39851] Time.now + str と #to_r — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
9 messages
2009/12/07
[#39852] Re: Time.now + str と #to_r
— "NARUSE, Yui" <naruse@...>
2009/12/07
成瀬です。
[#39855] [RubySpec #2460] RubySpecでFiberのSpecがおちる — 三村 益隆 <redmine@...>
RubySpec #2460: RubySpecでFiberのSpecがおちる
4 messages
2009/12/08
[#39863] [Feature #2471] want to choose a GC algorithm — _ wanabe <redmine@...>
Feature #2471: want to choose a GC algorithm
8 messages
2009/12/09
[#39874] faster Enumerator#each by rb_block_call with current block — Yusuke ENDOH <mame@...>
遠藤です。
7 messages
2009/12/13
[#39894] Re: faster Enumerator#each by rb_block_call with current block
— Yukihiro Matsumoto <matz@...>
2009/12/19
まつもと ゆきひろです
[#39897] Re: faster Enumerator#each by rb_block_call with current block
— Yusuke ENDOH <mame@...>
2009/12/20
遠藤です。
[#39912] [Bug #2522] Segmentation Fault is occurred on r26158 by running rubyspec — Kenta Murata <redmine@...>
Bug #2522: Segmentation Fault is occurred on r26158 by running rubyspec
4 messages
2009/12/23
[ruby-dev:39862] [Feature #2470] Encoding#new doesn't undef_method-ed
From:
Yui NARUSE <redmine@...>
Date:
2009-12-09 23:03:37 UTC
List:
ruby-dev #39862
Feature #2470: Encoding#new doesn't undef_method-ed
http://redmine.ruby-lang.org/issues/show/2470
起票者: Yui NARUSE
ステータス: Open, 優先度: Normal
カテゴリ: core
Fixnum や Encoding のような、rb_undef_alloc_func されているクラスでは、
Hoge.new がエラーになりますが、
Fixnum などでは Fixnum.new が undef されているのに、
Encoding ではなされていないため、呼んだ際の挙動が異なります。
irb(main):001:0> Fixnum.new
NoMethodError: undefined method `new' for Fixnum:Class
from (irb):1
from /usr/local/bin/irb_1_9_1:12:in `<main>'
irb(main):002:0> Encoding.new
TypeError: allocator undefined for Encoding
from (irb):2:in `new'
from (irb):2
from /usr/local/bin/irb_1_9_1:12:in `<main>'
以下がパッチです。
diff --git a/encoding.c b/encoding.c
index 38d81b8..f9d2f20 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1484,6 +1484,7 @@ Init_Encoding(void)
rb_cEncoding = rb_define_class("Encoding", rb_cObject);
rb_undef_alloc_func(rb_cEncoding);
+ rb_undef_method(CLASS_OF(rb_cEncoding), "new");
rb_define_method(rb_cEncoding, "to_s", enc_name, 0);
rb_define_method(rb_cEncoding, "inspect", enc_inspect, 0);
rb_define_method(rb_cEncoding, "name", enc_name, 0);
diff --git a/object.c b/object.c
index 10eb983..704cb2a 100644
--- a/object.c
+++ b/object.c
@@ -2680,6 +2680,7 @@ Init_Object(void)
rb_cData = rb_define_class("Data", rb_cObject);
rb_undef_alloc_func(rb_cData);
+ rb_undef_method(CLASS_OF(rb_cData), "new");
rb_cTrueClass = rb_define_class("TrueClass", rb_cObject);
rb_define_method(rb_cTrueClass, "to_s", true_to_s, 0);
diff --git a/vm.c b/vm.c
index fa028fd..e522c9f 100644
--- a/vm.c
+++ b/vm.c
@@ -1944,6 +1944,7 @@ Init_VM(void)
/* ::VM */
rb_cRubyVM = rb_define_class("RubyVM", rb_cObject);
rb_undef_alloc_func(rb_cRubyVM);
+ rb_undef_method(CLASS_OF(rb_cRubyVM), "new");
/* ::VM::FrozenCore */
fcore = rb_class_new(rb_cBasicObject);
@@ -1962,6 +1963,7 @@ Init_VM(void)
/* ::VM::Env */
rb_cEnv = rb_define_class_under(rb_cRubyVM, "Env", rb_cObject);
rb_undef_alloc_func(rb_cEnv);
+ rb_undef_method(CLASS_OF(rb_cEnv), "new");
/* ::Thread */
rb_cThread = rb_define_class("Thread", rb_cObject);
----------------------------------------
http://redmine.ruby-lang.org