peterhuene opened PR #2741 from refactor-fiber-stacks
to main
:
This PR splits out a
FiberStack
fromFiber
, allowing the instance
allocator trait to returnFiberStack
rather 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
assert
that thestack
is not owned? (e.g. that thestack
was created byallocate
above)
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 inwasmtime
was to provide the ability to avoid compiling thewasmtime-fiber
crate 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 theasync
feature everywhere.
alexcrichton created PR Review Comment:
Aha I now see though that this is because
wasmtime-fiber
was 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
StackPool
which references thewasmtime-fiber
types.
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 ofcfg
to 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: Nov 22 2024 at 16:03 UTC