[ruby-core:80997] Re: [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE

From: Eric Wong <normalperson@...>
Date: 2017-05-04 20:36:02 UTC
List: ruby-core #80997
sam.saffron@gmail.com wrote:
> https://bugs.ruby-lang.org/issues/13544

> Currently the only way to load an InstructionSequence is to load the data into a Ruby RVALUE and then pass it to #load_from_binary
> 
> This is inefficient as it forces one extra potentially very large RVALUE slot.

Can using String#clear help your case right now?

> It would be nice if c extensions could load an instruction sequence directly from c buffer. 

Maybe adding mmap support (at least read-only) to IO objects can
support this...

There will be portability problems, though; and we need to be
careful about the file being changed (especially truncated)
while reading via mmap is happening.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread