Skip to content

wasm2c: support mmap on non default memory size - #2910

Merged
shravanrn merged 1 commit into
WebAssembly:mainfrom
UT-Security:mmap-nondefault-memsize
Nov 2, 2026
Merged

shravanrn merged 1 commit into
WebAssembly:mainfrom
UT-Security:mmap-nondefault-memsize

Conversation

@shravanrn

Copy link
Copy Markdown
Collaborator

wasm2c currently falls back to malloc on non default page size even if WASM_RT_USE_MMAP. This unfortunately complicates the runtime unnecessarily. This PR unifies how WASM_RT_USE_MMAP is handled for all Wasm memory 32 allocations.

@shravanrn
shravanrn requested review from keithw and sbc100 October 29, 2026 07:41
@shravanrn

Copy link
Copy Markdown
Collaborator Author

Note: although this PR adds code, it unifies code paths. This will in turn simplify the next set of changes I've planned which will optimize perf for memory32 on 32-bit systems.

Comment thread wasm2c/wasm-rt-mem-impl.c Resolved
@shravanrn
shravanrn force-pushed the mmap-nondefault-memsize branch from cfd2c82 to b85bd0c Compare October 29, 2026 22:27
@shravanrn

Copy link
Copy Markdown
Collaborator Author

@sbc100 Please have a look and approve the PR when possible. I am waiting to land a couple more changes that build on this.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm % comments

Comment thread wasm2c/wasm-rt-mem-impl.c Resolved
@shravanrn
shravanrn force-pushed the mmap-nondefault-memsize branch from b85bd0c to 580a375 Compare November 2, 2026 19:36
@shravanrn
shravanrn enabled auto-merge (rebase) November 2, 2026 19:36
@shravanrn
shravanrn force-pushed the mmap-nondefault-memsize branch from 580a375 to 5104b1b Compare November 2, 2026 19:38
@shravanrn
shravanrn merged commit a6d423d into WebAssembly:main Nov 2, 2026
19 checks passed
@shravanrn
shravanrn deleted the mmap-nondefault-memsize branch November 2, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants