diff --git a/ChangeLog b/ChangeLog index 1d629fd780..5bee6dbcf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 19 21:14:28 2012 Narihiro Nakamura + + * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821] + + * test/ruby/test_gc.rb: add test-case for this bug. + Wed Dec 19 21:12:49 2012 Shugo Maeda * marshal.c (r_entry0): don't taint classes and modules because diff --git a/gc.c b/gc.c index 01d908d1b7..1d37e0ceb4 100644 --- a/gc.c +++ b/gc.c @@ -627,7 +627,7 @@ static VALUE gc_profile_enable_get(VALUE self) { rb_objspace_t *objspace = &rb_objspace; - return objspace->profile.run; + return objspace->profile.run ? Qtrue : Qfalse; } /* diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index bcc490626d..63bec82aad 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -97,4 +97,13 @@ class TestGc < Test::Unit::TestCase 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 diff --git a/version.h b/version.h index afaae0cc4e..b803415eb7 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 342 +#define RUBY_PATCHLEVEL 343 #define RUBY_RELEASE_DATE "2012-12-19" #define RUBY_RELEASE_YEAR 2012