[#62297] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap. — Eric Wong <normalperson@...>
nari@ruby-lang.org wrote:
7 messages
2014/05/02
[#62307] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— SASADA Koichi <ko1@...>
2014/05/03
(2014/05/03 4:41), Eric Wong wrote:
[#62402] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— Eric Wong <normalperson@...>
2014/05/05
SASADA Koichi <ko1@atdot.net> wrote:
[#62523] [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan — ko1@...
Issue #9632 has been updated by Koichi Sasada.
3 messages
2014/05/11
[#62556] doxygen (Re: Re: [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan) — Tanaka Akira <akr@...>
2014-05-11 8:50 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
3 messages
2014/05/13
[#62727] [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl — Eric Wong <normalperson@...>
rb_unlink_method_entry may cause old_me to be swept before the new
7 messages
2014/05/24
[#63039] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/10
Hi,
[#63077] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/10
SASADA Koichi <ko1@atdot.net> wrote:
[#63086] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/11
(2014/06/11 4:47), Eric Wong wrote:
[#63087] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/11
SASADA Koichi <ko1@atdot.net> wrote:
[#62862] [RFC] README.EXT: document rb_gc_register_mark_object — Eric Wong <normalperson@...>
Any comment on officially supporting this as part of the C API?
5 messages
2014/05/30
[ruby-core:62418] [ruby-trunk - Bug #5828] [Feedback] Non anonymous classes can't be frozen, cloned and then inspected
From:
akr@...
Date:
2014-05-06 13:50:23 UTC
List:
ruby-core #62418
Issue #5828 has been updated by Akira Tanaka.
Status changed from Assigned to Feedback
The name of anonymous class is searched and cached when it is first inspected.
The cache is implemented as a hidden instance variable of the class.
If the class is frozen, the cache is failed as the exception because the instance variable is not assignable.
Note that Class.new.freeze.to_s doesn't raise the exception.
This is because Kernel#freeze is redefined by Module#freeze and it caches the class name before freezing.
Kernel#clone is not redefined.
So there is not such trick to avoid the exception.
I'm not sure that it is worth to fix this problem.
----------------------------------------
Bug #5828: Non anonymous classes can't be frozen, cloned and then inspected
https://bugs.ruby-lang.org/issues/5828#change-46568
* Author: Andrew Grimm
* Status: Feedback
* Priority: Low
* Assignee: Akira Tanaka
* Category:
* Target version:
* ruby -v: ruby 2.0.0dev (2011-11-27 trunk 33860) [x86_64-darwin10.8.0]
* Backport:
----------------------------------------
=begin
If you assign a class to a constant (that is, it isn't anonymous), and you freeze it and then clone it, you can't call to_s on it.
MyClass = Class.new ; MyClass.freeze.clone.to_s
RuntimeError: can't modify frozen Class
from (irb):1:in `to_s'
from (irb):1
from /Users/agrimm/.rvm/rubies/ruby-head/bin/irb:16:in `<main>'
MyConstantObject = Object.new ; MyConstantObject.freeze.clone.to_s # => "#<Object:0x00000100884d60>"
MyClass_2 = Class.new ; MyClass_2.clone.to_s # => "#<Class:0x00000100872930>"
MyClass_3 = Class.new ; MyClass_3.freeze.to_s # => "MyClass_3"
MyClass_4 = Class.new.freeze ; MyClass_4.clone.to_s # => "#<Class:0x0000010088d4d8>"
MyClass_5 = Class.new.freeze ; MyClass_5.freeze.clone.to_s # => An exception
local_variable_class = Class.new ; local_variable_class.freeze.clone.to_s # => "#<Class:0x00000100964028>"
Presumably this is caused by class only determining whether it's assigned to a constant when it's first inspected.
I don't have a use case for freezing and cloning a class.
=end
--
https://bugs.ruby-lang.org/