Project

General

Profile

Actions

Bug #6821

closed

GC::Profiler.enabled? returns 0 when enabled

Added by dbussink (Dirkjan Bussink) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.3p194
Backport:
[ruby-core:46919]

Description

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

Actions

Also available in: Atom PDF

Like0
Like0Like0