[#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:70580] [Ruby trunk - Feature #11484] [Open] add output offset for readpartial/read_nonblock/etc
From:
normalperson@...
Date:
2015-08-24 19:29:27 UTC
List:
ruby-core #70580
Issue #11484 has been reported by Eric Wong.
----------------------------------------
Feature #11484: add output offset for readpartial/read_nonblock/etc
https://bugs.ruby-lang.org/issues/11484
* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
~~~
Specifying a destination offset will allow allocating less garbage
strings to improve performance when reading partial data off a pipe
or socket.
For example:
tmp = "".b
buf = "".b
case rv = io.read_nonblock(8192, tmp, exception: false)
when String
buf << tmp
break if parsing_done?(buf)
else
return rv
end while true
Can be written as:
buf = "".b
case rv = io.read_nonblock(8192, buf, exception: false, off_out: buf.size)
when String
break if parsing_done?(buf)
else
return rv
end while true
For reference, here is the relevant part from "perldoc -f sysread"
sysread FILEHANDLE,SCALAR,LENGTH,OFFSET
sysread FILEHANDLE,SCALAR,LENGTH
-snip-
An OFFSET may be specified to place the read data at some place
in the string other than the beginning. A negative OFFSET
specifies placement at that many characters counting backwards
from the end of the string. A positive OFFSET greater than the
length of SCALAR results in the string being padded to the
required size with "\0" bytes before the result of the read is
appended.
-snip-
Maybe we can shortcut by allowing "off_out: :end" to avoid redundant
words and potentially using the wrong variable:
io.read_nonblock(8192, buf, exception: false, off_out: :end)
I'm not sure when I'll have time to work on this feature.
Lately I've been working in Perl again and rediscovered this API subtlety.
~~~
--
https://bugs.ruby-lang.org/