ruby-changes:22021
From: nobu <ko1@a...>
Date: Sun, 18 Dec 2011 14:35:01 +0900 (JST)
Subject: [ruby-changes:22021] nobu:r34070 (trunk): * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
nobu 2011-12-18 14:34:34 +0900 (Sun, 18 Dec 2011) New Revision: 34070 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34070 Log: * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow allocation framework right now. [ruby-core:41710] [Bug #5773] Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c trunk/test/bigdecimal/test_bigdecimal.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 34069) +++ ChangeLog (revision 34070) @@ -1,3 +1,8 @@ +Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@r...> + + * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow + allocation framework right now. [ruby-core:41710] [Bug #5773] + Sun Dec 18 12:42:48 2011 Aaron Patterson <aaron@t...> * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 34069) +++ ext/bigdecimal/bigdecimal.c (revision 34070) @@ -2830,12 +2830,16 @@ /* Class and method registration */ rb_cBigDecimal = rb_define_class("BigDecimal",rb_cNumeric); + rb_undef_alloc_func(rb_cBigDecimal); /* TODO: define alloc func */ /* Global function */ rb_define_global_function("BigDecimal", BigDecimal_global_new, -1); /* Class methods */ +#if 1 + /* TODO: follow allocation framework */ rb_define_singleton_method(rb_cBigDecimal, "new", BigDecimal_new, -1); +#endif rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1); rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1); rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0); Index: test/bigdecimal/test_bigdecimal.rb =================================================================== --- test/bigdecimal/test_bigdecimal.rb (revision 34069) +++ test/bigdecimal/test_bigdecimal.rb (revision 34070) @@ -19,6 +19,10 @@ [ BigDecimal::ROUND_FLOOR, :floor], ] + def assert_allocate + assert_raise(TypeError) {BigDecimal.allocate} + end + def assert_nan(x) assert(x.nan?, "Expected #{x.inspect} to be NaN") end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/