Issue #6821 has been updated by nobu (Nobuyoshi Nakada).

Category set to core
Status changed from Open to Assigned
Assignee set to authorNari (Narihiro Nakamura)
Target version set to 2.0.0


----------------------------------------
Bug #6821: GC::Profiler.enabled? returns 0 when enabled
https://bugs.ruby-lang.org/issues/6821#change-28584

Author: dbussink (Dirkjan Bussink)
Status: Assigned
Priority: Normal
Assignee: authorNari (Narihiro Nakamura)
Category: core
Target version: 2.0.0
ruby -v: 1.9.3p194


GC::Profiler.enabled? returns 0 when GC::Profiler is enabled, contrary to the documentation that states it returns either true or false. Looking at the code, I think it's an oversight because objspace->profile.run isn't properly wrapped for a VALUE. So TRUE is returned, which is 1 as a VALUE which equals the value for the Fixnum 0. 

This changeset should fix the problem:

https://gist.github.com/9fe02bd47515cbbcced7


-- 
http://bugs.ruby-lang.org/