alexcrichton opened PR #11 from new-api to main:
Overhaul the
wasmtimecrate's API to improve it along a number of vectors:
Greatly improve the multithreading story in all languages (Rust, C, Go, ...),
namely enabling safe usage ofwasmtimein multithreaded server runtimes
where wasm objects can migrate between threads.Leverage mutability in Rust to allow
&mutaccess to user-defined state
instead of requiring users to use interior mutability.Simplify memory management in the C API and embeddings.
The only major cost relative to today's API is that
ExternRefwill move to
atomic reference counting and will requireT: Send + Syncon constructors.
bnjbvr submitted PR Review.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
self`. The reason for this is that everything is effectively behind an `Rc`
bnjbvr created PR Review Comment:
Above it is suggested that having the
StorebeSend + Syncis optional and depends onTbeingSend + Synctoo; so is this a strong requirement, even when the embedder doesn't need aSend + SyncStore?
bnjbvr created PR Review Comment:
Should the first parameter be
cx: impl AsContextMuthere?
bnjbvr created PR Review Comment:
Are these two functions doing more than what the
AsContext/Muttrait methods provide?
bnjbvr created PR Review Comment:
* Management of memory in the API can sometimes be confusing. Additionally for C
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
That's correct, regardless of whether the embedder needs
SendandSynchost functions will always be required to beSendandSync. This is thought to be ok, though, because most host state should be stored inTrather than in the funtion itself, and it's expected that the majority of host functions are simply 0-sized closures that are just code and no data.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Nah they're just explicitly named so if users want to call them they don't have to import the trait. I'm not sure if this makes sense but it's always an option we can have of course!
alexcrichton updated PR #11 from new-api to main.
alexcrichton updated PR #11 from new-api to main.
alexcrichton updated PR #11 from new-api to main.
bjorn3 created PR Review Comment:
it's simply an index into the `Store`. This implementation detail is how the
bjorn3 submitted PR Review.
alexcrichton updated PR #11 from new-api to main.
pchickey submitted PR review.
peterhuene submitted PR review.
jedisct1 submitted PR review.
sunfishcode submitted PR review.
sunfishcode submitted PR review.
sunfishcode created PR review comment:
`wasm.h` which does not have any sort of context handle passed around anywhere.
alexcrichton updated PR #11 from new-api to main.
bjorn3 submitted PR review.
radu-matei submitted PR review.
abrown submitted PR review.
thomastaylor312 submitted PR review.
bacongobbler submitted PR review.
bnjbvr submitted PR review.
alexcrichton merged PR #11.
Last updated: Dec 06 2025 at 06:05 UTC