peterhuene opened PR #2741 from refactor-fiber-stacks to main:
This PR splits out a
FiberStackfromFiber, allowing the instance
allocator trait to returnFiberStackrather than raw stack pointers. This
keeps the stack creation mostly inwasmtime_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.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Could this have an
assertthat thestackis not owned? (e.g. that thestackwas created byallocateabove)
alexcrichton created PR Review Comment:
Not to say this is too much
#[cfg]that we should remove this, just pointing out the original motivation in case you felt like this is too much#[cfg].
alexcrichton created PR Review Comment:
FWIW I've seen a lot of
#[cfg]annotations being added here like this, but the main purpose of an optional feature inwasmtimewas to provide the ability to avoid compiling thewasmtime-fibercrate since it has custom assembly stubs that don't work everywhere. For a crate likewasmtime-runtime, though, including functions which are never used is only a marginal hit to compile time so I don't think it's necessarily required that we propagate theasyncfeature everywhere.
alexcrichton created PR Review Comment:
Aha I now see though that this is because
wasmtime-fiberwas picked up as a dependency.In that case I think it may be worthwhile to basically just avoid the conditional parameters of stack sizes, and otherwise leaving these annotations as-is by avoiding compiling in a
StackPoolwhich references thewasmtime-fibertypes.
alexcrichton created PR Review Comment:
FWIW I think it's fine to have an extra field like this that isn't conditional, it does add a fair amount of boilerplate to use
#[cfg]and we're not necessarily getting a whole lot out of it.
peterhuene submitted PR Review.
peterhuene created PR Review Comment:
I can add it back in as I might have gotten carried away with cutting out anything having to do with "execution stacks" from the runtime without
async. It definitely added a lot ofcfgto get right and it clutters up the code.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene updated PR #2741 from refactor-fiber-stacks to main.
peterhuene requested alexcrichton for a review on PR #2741.
alexcrichton submitted PR Review.
peterhuene merged PR #2741.
Last updated: Dec 06 2025 at 06:05 UTC