Virtual file support (#701)

* Add support for virtual files (eg, not backed by an OS file).

Virtual files are implemented through trait objects, with a default
implementation that tries to behave like on-disk files, but entirely
backed by in-memory structures.

Co-authored-by: Dan Gohman <sunfish@mozilla.com>
This commit is contained in:
iximeow
2020-03-06 11:08:13 -08:00
committed by GitHub
parent 7f7196a655
commit 7e0d9decbf
19 changed files with 1568 additions and 188 deletions

View File

@@ -207,7 +207,7 @@ pub(crate) fn dec_ciovec_slice(
.iter()
.map(|raw_iov| {
let len = dec_usize(PrimInt::from_le(raw_iov.buf_len));
let buf = PrimInt::from_le(raw_iov.buf);
let buf: u32 = PrimInt::from_le(raw_iov.buf);
Ok(host::__wasi_ciovec_t {
buf: dec_ptr(memory, buf, len)? as *const u8,
buf_len: len,