Skip to content

Exclude asynchronous handle scanning from single-threaded builds - #137071

Merged
MichalStrehovsky merged 2 commits into
dotnet:mainfrom
MichalStrehovsky:gcscan
Nov 8, 2026
Merged

MichalStrehovsky merged 2 commits into
dotnet:mainfrom
MichalStrehovsky:gcscan

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Guard asynchronous handle-table dispatch and scanner support with FEATURE_MULTITHREADING. Assert synchronous scan requests without rewriting caller inputs, while preserving handle-table layout and multithreaded behavior.

Taking the address of the function pulls in 2 kB of unnecessary code. If we don't want to take this PR, it's fine, 2 kB is not a huge deal.

Guard asynchronous handle-table dispatch and scanner support with FEATURE_MULTITHREADING. Assert synchronous scan requests without rewriting caller inputs, while preserving handle-table layout and multithreaded behavior.

This provides a 2,356 byte size saving for the size-optimized WASI NativeAOT Release Hello World, shrinking it from 825,570 to 823,214 bytes.

Validated WASI Release/Checked handle-GC probes and Preinitialization, and built Windows x64 Debug workstation/server GC runtimes.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9bc3dfee-1040-4648-bdad-86922a749613
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @anicka-net, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Comment thread src/coreclr/gc/handletablescan.cpp Resolved
Keep FEATURE_MULTITHREADING guards only at asynchronous dispatch sites and remove fine-grained scanner and lock-construction guards, addressing review feedback.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: b9c54b14-a38c-42b9-89c4-ffacfcc2fe80
@MichalStrehovsky
MichalStrehovsky merged commit 0ca316a into dotnet:main Nov 8, 2026
101 checks passed
@MichalStrehovsky
MichalStrehovsky deleted the gcscan branch November 8, 2026 23:48
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-GC-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants