-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
let subs_base = in_subs + (SUBSCRIPTION_SIZE * (i as u32)); | ||
const SUBSCRIPTION_SIZE: u32 = 48; // user data + 40-byte union | ||
for index in 0..num_subscriptions { | ||
let subs_base = in_subs + (SUBSCRIPTION_SIZE * index); | ||
let subs_type = mem.read_u32(subs_base + 8); | ||
if subs_type != 0 { | ||
// not a clock subscription type | ||
continue; | ||
} | ||
let user_data = mem.read_u32(subs_base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also read more properties of the clock and advance time here.. though probably not too important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some extra passage of time at the top of poll_oneshot
} | ||
} | ||
|
||
impl Deref for GuestPtr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need deref and deref mut? I'm worried implementing them for a GuestPtr will seem like we access the guest data and not the underline uint32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added them so that we could auto-implement a bunch of math functions.
How's this, I've just removed DerefMut
but kept Deref
for the read-only ops :)
fn brotli_compress(in_buf_ptr: GuestPtr, in_buf_len: u32, out_buf_ptr: GuestPtr, out_len_ptr: GuestPtr, level: u32, window_size: u32) -> BrotliStatus | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I see you added into the git: arbitrator/wasm-libraries/go-js-test/js-test.wasm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(probably worthwhile even editing the commit and force-pushing the branch, to avoid adding that 2.5MB data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-wrote history :)
ef1ca35
to
fff7887
Compare
47beb58
to
afb9c61
Compare
afb9c61
to
8cfb8c4
Compare
This PR provides final review edits for go-wasi, which consists of the following PRs.
In particular, this PR
GuestPtr
to complete theUptr
concept. This provides additional safety since it's no longer just a alias. This is possible via the new traits provided by thewasmer-traits
feature flag incaller-env
(new name), which allows us to use these types in wasmer Host I/Os directly. Applying these changes lead to type checking errors, revealing each instance of accidentalu32
<=> pointer type confusion. These have been fixed & made consistent :)wrap!
macro is now multi-line and allows you to write more complete functions.ThreadState
type instead of anOption
for tracking the cothread state in the machine. This makes things easier to read & audit.GoSliceData
andSendGoSliceData
into one type (updated in notion too btw). We do this by a manual impl ofSend
.handleReqImpl
where Go and Rust type-confusedrustBytes
vsrustSlice
.wasip1
get_args
successful.read_u32/64
andwrite_u32/64
and reduces copies throughout the system.!wasm
build tagsevmApi
innative.go
to be receiver based.startInk
and the tworequire_gas
's inUserHost
.Closes STY-7
Associated PRs