Stream: git-wasmtime

Topic: wasmtime / Issue #1329 [wasi-common] add custom FdPool co...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2020 at 20:11):

kubkon commented on Issue #1329:

@sunfishcode I've applied the tweaks to the design as discussed offline on Zulip. Here's the summary of the changes:

The underlying type in FdPool which we use to track and represent raw file descriptors is now u32. As a result, the structure of FdPool is simplified massively as we no longer need to track the claimed descriptors; in a way, we trust the caller to return the handle after it's done with it. In case the caller decides to be clever and return a handle which was not yet legally allocated, we panic. This should never be a problem in wasi-common unless we hit a bug.

To make all of this work, Fd trait is modified to require two methods: as_raw(&self) -> u32 and from_raw(raw_fd: u32) -> Self both of which are used to convert to and from the FdPool's underlying type u32.


Last updated: Dec 23 2024 at 12:05 UTC