Files
wasmtime/crates
Alex Crichton 704db02e00 Add a first-class StoreId type to Wasmtime (#4204)
* 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 ordering
2022-06-01 14:46:21 -05:00
..
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00
2022-05-05 13:43:02 -05:00