Skip to content

Conversation

@radekdoulik
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request disables remaining madvise system calls for WebAssembly (WASM) targets across both CoreCLR and native libraries. WebAssembly doesn't support madvise operations, so these calls need to be conditionally compiled out to prevent runtime issues.

Key changes:

  • Added !defined(TARGET_WASM) guards to madvise calls in native I/O and CoreCLR memory management code
  • Introduced early return in GCToOSInterface::VirtualReset for WASM targets
  • Updated conditional compilation for memory advise operations in PAL mapping code

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/native/libs/System.Native/pal_io.c Added TARGET_WASM exclusion to MADV_DONTFORK conditional compilation and updated corresponding comment
src/coreclr/pal/src/map/map.cpp Extended platform exclusion in MAPMarkSectionAsNotNeeded to also skip WASM targets alongside Android
src/coreclr/gc/unix/gcenv.unix.cpp Added WASM guards to multiple madvise calls in VirtualDecommit and VirtualReset, with early return optimization for WASM in VirtualReset

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@radekdoulik radekdoulik merged commit 101210f into dotnet:main Jan 8, 2026
147 of 153 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants