Don't pin named structs defined in Ruby
[Bug #20311]
rb_define_class_under assumes it's called from C and that the reference might be held in a C global variable, so it adds the class to the VM root.
rb_define_class_under
In the case of Struct.new('Name') it's wasteful and make the struct immortal.
Struct.new('Name')
Don't pin named structs defined in Ruby
[Bug #20311]
rb_define_class_underassumes it's called from C and that thereference might be held in a C global variable, so it adds the
class to the VM root.
In the case of
Struct.new('Name')it's wasteful and makethe struct immortal.