[#70252] Re: [ruby-cvs:58640] nobu:r51492 (trunk): node.c: NODE_ALLOCA for ALLOCV — Eric Wong <normalperson@...>
Besides possible backwards compatibility, can we drop volatile
3 messages
2015/08/05
[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...
Issue #11420 has been reported by Koichi Sasada.
11 messages
2015/08/06
[#70337] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/11
Nice. Thank you guys for looking into this.
[#70349] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
Btw, did you consider using flexible array to avoid extra malloc
[#70355] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Юрий Соколов <funny.falcon@...>
2015/08/12
I thought to suggest to embed hash_id_table directly into places when it is
[#70356] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— SASADA Koichi <ko1@...>
2015/08/12
On 2015/08/13 4:29, Юрий Соколов wrote:
[#70358] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
SASADA Koichi <ko1@atdot.net> wrote:
[#70509] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — ko1@...
Issue #11276 has been updated by Koichi Sasada.
3 messages
2015/08/21
[#70639] the undefined behavior of an iterator if it is modified inside of the block to which it yields — Daniel Doubrovkine <dblock@...>
(this is my first time e-mailing list list, so apologies for any misstep :)
4 messages
2015/08/31
[ruby-core:70528] Re: [Ruby trunk - Feature #11473] [Open] Immutabe String literal on Ruby 3
From:
Eric Wong <normalperson@...>
Date:
2015-08-21 19:29:18 UTC
List:
ruby-core #70528
I am against breaking compatibility; this can be a subtle change
that breaks old code in ways that may not be obvious.
However, I think we may be able to workaround transparently from Ruby
layer. The C API will gets expanded, but should remain
backwards-compatible.
I propose a "half-frozen" state for strings:
1) string literals are created as "half-frozen" by default
2) eliminate "putstring" instruction from VM
3) Introduce "VALUE rb_str_modify_dup(str)" function:
VALUE
__attribute__((warn_unused_result)) /* important! */
rb_str_modify_dup(VALUE str)
{
if (rb_str_half_frozen_p(str)) {
/* like putstring */
return rb_str_resurrect(str);
}
/* like current rb_str_modify: */
rb_str_modify_internal(str);
return str;
}
4) modify rb_define_method (and rb_define_private_method, etc...)
to flag and call rb_str_resurrect unconditionally for half-frozen
strings before calling any old cfunc
5) deprecate rb_define_method and rb_str_modify, they will exist
indefinitely for backwards compatibility
6) create rb_define_method_3_0 (temporary name) which assumes
the cfunc is aware of half-frozen strings (e.g. rb_str_modify
calls replaced with rb_str_modify_dup calls)
7) gradual transition of existing code to rb_define_method_3_0
Fwiw, I have a lot of legacy Perl 5 code written from many years ago
that work fine today. Even nowadays, I still choose to do start new
projects with Perl 5 because I can expect it remain working in the
future.
I hope I can rely on Ruby to have similar stability someday.
Side note: I also propose we also skip (argc == -1 / rb_scan_args)
support from rb_define_method_3_0 because of [Feature #11339] (for
kwarg parsing speedups)