[#62904] [ruby-trunk - Feature #9894] [Open] [RFC] README.EXT: document rb_gc_register_mark_object — normalperson@...
Issue #9894 has been reported by Eric Wong.
3 messages
2014/06/02
[#63321] [ANN] ElixirConf 2014 - Don't Miss Jos辿 Valim and Dave Thomas — Jim Freeze <jimfreeze@...>
Just a few more weeks until ElixirConf 2014!
6 messages
2014/06/24
[#63391] Access Modifiers (Internal Interfaces) — Daniel da Silva Ferreira <danieldasilvaferreira@...>
Hi,
3 messages
2014/06/28
[ruby-core:63145] [ruby-trunk - Bug #9938] ObjectSpace::allocation_class_path does not object's class
From:
nobu@...
Date:
2014-06-12 22:01:17 UTC
List:
ruby-core #63145
Issue #9938 has been updated by Nobuyoshi Nakada.
Description updated
----------------------------------------
Bug #9938: ObjectSpace::allocation_class_path does not object's class
https://bugs.ruby-lang.org/issues/9938#change-47203
* Author: David Unric
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* Category: core
* Target version:
* ruby -v: 2.1.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Possible bug in `ObjectSpace::allocation_class_path` returning `nil` instead of expected class name:
~~~ruby
require 'objspace'
class A
def foo
ObjectSpace::trace_object_allocations do
obj = Object.new
p ObjectSpace::allocation_class_path(obj) # "A" expected, prints nil instead
obj = Array.new
p ObjectSpace::allocation_class_path(obj) # "A" expected, prints nil instead
obj = []
p ObjectSpace::allocation_class_path(obj) # prints "A" as expected !!
obj = obj.dup
p ObjectSpace::allocation_class_path(obj) # "A" expected, prints nil instead !!
obj = Hash.new
p ObjectSpace::allocation_class_path(obj) # "A" expected, prints nil instead
obj = {}
p ObjectSpace::allocation_class_path(obj) # prints "A" as expected !!
end
end
end
A.new.foo
~~~
Very inconsistent behavior, `allocation_class_path` seems to works only with objects defined with literals not instantiated with `class.new` method.
Also discussed at StackOverflow:
http://stackoverflow.com/questions/24181789/objectspaceallocation-class-path-not-working-as-expected
--
https://bugs.ruby-lang.org/