Skip to content

Conversation

@cfallin
Copy link
Member

@cfallin cfallin commented Jan 9, 2026

This method is informational for embedders to be able to, for example, ensure an image in memory is mlock'd (not swapped out). In the refactors around the StoreCode/EngineCode split, I mistakenly redefined this to only the text section. This is not a Wasm execution correctness issue but may lead to performance issues if an embedder relies on this behavior. This PR fixes the definition.

Fixes #12284.

This method is informational for embedders to be able to, for example,
ensure an image in memory is `mlock`'d (not swapped out). In the
refactors around the StoreCode/EngineCode split, I mistakenly redefined
this to only the text section. This is not a Wasm execution correctness
issue but may lead to performance issues if an embedder relies on this
behavior. This PR fixes the definition.
@cfallin cfallin requested a review from a team as a code owner January 9, 2026 08:27
@cfallin cfallin requested review from fitzgen and removed request for a team January 9, 2026 08:27
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jan 9, 2026
@jeffcharles
Copy link
Contributor

jeffcharles commented Jan 9, 2026

Can you also fix image_range in Component? It looks like it had the same change in implementation in #12051 and we also are using that method in wasmtime-rb.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with @jeffcharles's comment

@cfallin
Copy link
Member Author

cfallin commented Jan 9, 2026

Ah, missed that -- thanks!

@cfallin cfallin enabled auto-merge January 9, 2026 16:17
@cfallin cfallin added this pull request to the merge queue Jan 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 9, 2026
@cfallin cfallin enabled auto-merge January 9, 2026 18:53
@cfallin cfallin added this pull request to the merge queue Jan 9, 2026
Merged via the queue into bytecodealliance:main with commit 5566d52 Jan 9, 2026
45 checks passed
@cfallin cfallin deleted the fix-image-range branch January 9, 2026 19:29
alexcrichton pushed a commit to alexcrichton/wasmtime that referenced this pull request Jan 9, 2026
…dealliance#12302)

* Fix `Module::image_range` to include non-text part of module.

This method is informational for embedders to be able to, for example,
ensure an image in memory is `mlock`'d (not swapped out). In the
refactors around the StoreCode/EngineCode split, I mistakenly redefined
this to only the text section. This is not a Wasm execution correctness
issue but may lead to performance issues if an embedder relies on this
behavior. This PR fixes the definition.

* Components as well as core modules.

* Ignore new tests in miri.
alexcrichton added a commit that referenced this pull request Jan 9, 2026
#12307)

* Fix `Module::image_range` to include non-text part of module.

This method is informational for embedders to be able to, for example,
ensure an image in memory is `mlock`'d (not swapped out). In the
refactors around the StoreCode/EngineCode split, I mistakenly redefined
this to only the text section. This is not a Wasm execution correctness
issue but may lead to performance issues if an embedder relies on this
behavior. This PR fixes the definition.

* Components as well as core modules.

* Ignore new tests in miri.

Co-authored-by: Chris Fallin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasmtime::module::image_range only returning size of text section starting in Wasmtime 40

3 participants