Browse Source
* Add a first-class `StoreId` type to Wasmtime This commit adds a `StoreId` type to uniquely identify a store internally within Wasmtime. This hasn't been created previously as it was never really needed but I've run across a case for its usage in the component model so I've gone ahead and split out a commit to add this type. While I was here in this file I opted to improve some other miscellaneous things as well: * Notes were added to the `Index` impls that unchecked indexing could be used in theory if we ever need it one day. * The check in `Index` for the same store should now be a bit lighter on codegen where instead of having a `panic!()` in the codegen for each `Index` there's now an out-of-line version which is `#[cold]`. This should improve codegen as calling a function with no arguments is slighly more efficient than calling the panic macro with one string argument. * An `assert!` guarded with a `cfg(debug_assertions)` was changed to a `debug_assert!`. * Allocation of a `StoreId` was refactored to a method on the `StoreId` itself. * Review comments * Fix an orderingpull/4211/head
Alex Crichton
2 years ago
committed by
GitHub
1 changed files with 67 additions and 30 deletions
Loading…
Reference in new issue