Split out fiber stacks from fibers.

This commit splits out a `FiberStack` from `Fiber`, allowing the instance
allocator trait to return `FiberStack` rather than raw stack pointers. This
keeps the stack creation mostly in `wasmtime_fiber`, but now the on-demand
instance allocator can make use of it.

The instance allocators no longer have to return a "not supported" error to
indicate that the store should allocate its own fiber stack.

This includes a bunch of cleanup in the instance allocator to scope stacks to
the new "async" feature in the runtime.

Closes #2708.
This commit is contained in:
Peter Huene
2021-03-18 17:09:36 -07:00
parent 59dfe4b9f4
commit f8f51afac1
20 changed files with 343 additions and 292 deletions

View File

@@ -13,6 +13,7 @@ edition = "2018"
[dependencies]
wasmtime-environ = { path = "../environ", version = "0.25.0" }
wasmtime-fiber = { path = "../fiber", version = "0.25.0", optional = true }
region = "2.1.0"
libc = { version = "0.2.82", default-features = false }
log = "0.4.8"
@@ -45,5 +46,7 @@ maintenance = { status = "actively-developed" }
[features]
default = []
async = ["wasmtime-fiber"]
# Enables support for userfaultfd in the pooling allocator when building on Linux
uffd = ["userfaultfd"]