ruby-changes:24542
From: nari <ko1@a...>
Date: Thu, 2 Aug 2012 11:48:16 +0900 (JST)
Subject: [ruby-changes:24542] nari:r36593 (trunk): * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821]
nari 2012-08-02 11:47:12 +0900 (Thu, 02 Aug 2012) New Revision: 36593 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36593 Log: * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821] * test/ruby/test_gc.rb: add test-case for this bug. Modified files: trunk/ChangeLog trunk/gc.c trunk/test/ruby/test_gc.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36592) +++ ChangeLog (revision 36593) @@ -1,3 +1,9 @@ +Thu Aug 2 11:39:25 2012 Narihiro Nakamura <authornari@g...> + + * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821] + + * test/ruby/test_gc.rb: add test-case for this bug. + Thu Aug 2 10:51:12 2012 Martin Bosslet <Martin.Bosslet@g...> * ext/openssl/lib/openssl/digest.rb Index: gc.c =================================================================== --- gc.c (revision 36592) +++ gc.c (revision 36593) @@ -672,7 +672,7 @@ gc_profile_enable_get(VALUE self) { rb_objspace_t *objspace = &rb_objspace; - return objspace->profile.run; + return objspace->profile.run ? Qtrue : Qfalse; } /* Index: test/ruby/test_gc.rb =================================================================== --- test/ruby/test_gc.rb (revision 36592) +++ test/ruby/test_gc.rb (revision 36593) @@ -109,4 +109,13 @@ assert_in_out_err([env, "-W1", "-e", "exit"], "", [], [], "[ruby-core:39795]") assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]") end + + def test_profiler_enabled + GC::Profiler.enable + assert_equal(true, GC::Profiler.enabled?) + GC::Profiler.disable + assert_equal(false, GC::Profiler.enabled?) + ensure + GC::Profiler.disable + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/