alexcrichton requested pchickey for a review on PR #11255.
alexcrichton opened PR #11255 from alexcrichton:more-safer-tables to bytecodealliance:main:
This is some more progress on #11179 aimed at improving the safety of management of tables internally within Wasmtime:
Instance::table_indexis removed as it can be replaced with data stored directly in theVMTableImportnow.Instance::get_tablenow returns&mut TableInstance::get_defined_table_with_lazy_initnow returns&mut TableInstance::with_defined_table_index_and_instancenow directly returnsDefinedTableIndexplusPin<&mut Instance>, codifying the ability to "laterally move" between instances.Instance::table_init_segmentwas refactored to "take" the tables during initialization and replace them afterwards, resolving the split borrow issue and removing anunsafeblock in the function.cc #11179
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #11255.
pchickey submitted PR review.
alexcrichton requested fitzgen for a review on PR #11255.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #11255.
alexcrichton updated PR #11255.
alexcrichton commented on PR #11255:
The Miri violation of stacked borrows is I believe legitimate, so I've added a new commit which improves the safety situation around
Table::copy. @pchickey mind reviewing that new commit as well?
alexcrichton updated PR #11255.
alexcrichton edited PR #11255:
This is some more progress on #11179 aimed at improving the safety of management of tables internally within Wasmtime:
Instance::table_indexis removed as it can be replaced with data stored directly in theVMTableImportnow.Instance::get_tablenow returns&mut TableInstance::get_defined_table_with_lazy_initnow returns&mut TableInstance::with_defined_table_index_and_instancenow directly returnsDefinedTableIndexplusPin<&mut Instance>, codifying the ability to "laterally move" between instances.Instance::table_init_segmentwas refactored to "take" the tables during initialization and replace them afterwards, resolving the split borrow issue and removing anunsafeblock in the function.Closes #11179
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton commented on PR #11255:
I've also flagged this as closing https://github.com/bytecodealliance/wasmtime/issues/11179 as this resolves all remaining bits I know of there, and I otherwise split out https://github.com/bytecodealliance/wasmtime/issues/11262 from that issue.
pchickey submitted PR review.
alexcrichton merged PR #11255.
Last updated: Dec 06 2025 at 07:03 UTC