Stream: t-compiler/const-eval

Topic: Zero copy fs writes for miri


Christian Poveda (Oct 24 2019 at 02:36, on Zulip):

Hello, I've been thinking about https://github.com/rust-lang/miri/issues/1007 and I wanted to build a solution that allows to implement the read and write shims for unix without having to write to intermediate buffers.

Christian Poveda (Oct 24 2019 at 02:42, on Zulip):

My first naive solution would be to do an Allocation::get_mut wrapper inside Memory that checks bounds just like Memory::write_bytes does (of course this might end in an horrible way, I haven't thought about the implications)

Christian Poveda (Oct 24 2019 at 02:43, on Zulip):

As an alternative for readI might be able to do something with the Read::bytes method, but that consumes the file itself so... I don't have high hopes in that direction.

Christian Poveda (Oct 24 2019 at 02:44, on Zulip):

@RalfJ , @oli let me know what you think :)

RalfJ (Oct 24 2019 at 07:37, on Zulip):

My first naive solution would be to do an Allocation::get_mut wrapper inside
Memory that checks bounds just like Memory::write_bytes does

get_mut still has a subtle contract: the caller must actually write to all the
bytes in the given range.
I would say, for us to do optimizations that involve exposing subtle APIs like
that, I'd first like to see benchmarks demonstrating that this cost is worth the
benefit.

(Just a quick reply via email; I'm too busy for Zulip for another week I'm afraid.)

Christian Poveda (Oct 24 2019 at 13:43, on Zulip):

Yes the subtle contract part was what I was worrying about

Christian Poveda (Oct 24 2019 at 13:43, on Zulip):

I'm going to go first for the correct way and then we can think about the fast way :P

Last update: Nov 15 2019 at 20:45UTC