Skip to content

Make ExclusiveSynchronizationContext less generic#12

Merged
centeredgebot[bot] merged 1 commit into
mainfrom
sync-context-generic
Sep 29, 2025
Merged

Make ExclusiveSynchronizationContext less generic#12
centeredgebot[bot] merged 1 commit into
mainfrom
sync-context-generic

Conversation

@brantburnett
Copy link
Copy Markdown
Contributor

Motivation

This may reduce JIT/AOT code size in some scenarios by moving some methods not impacted by the type of the awaiter out of the generic context.

Motivation
----------
This may reduce JIT/AOT code size in some scenarios by moving some
methods not impacted by the type of the awaiter out of the generic
context.
Copy link
Copy Markdown

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 refactoring removes the generic type parameter from ExclusiveSynchronizationContext to reduce JIT/AOT code generation overhead. The change moves the generic constraint from the class level to the Run method, allowing the synchronization context to be shared across different awaiter types while maintaining type safety.

  • Converted ExclusiveSynchronizationContext<TAwaiter> to a non-generic class
  • Made the Run method generic instead of the entire class
  • Updated all instantiation sites to use the simplified constructor

Reviewed Changes

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

File Description
src/CenterEdge.Async/ExclusiveSynchronizationContext.cs Removed generic type parameter from class and moved it to the Run method
src/CenterEdge.Async/AsyncHelper.cs Updated constructor calls to remove generic type arguments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@brantburnett brantburnett marked this pull request as ready for review September 29, 2025 12:48
@brantburnett
Copy link
Copy Markdown
Contributor Author

/merge

@centeredgebot centeredgebot Bot merged commit 4431b4d into main Sep 29, 2025
6 checks passed
@centeredgebot centeredgebot Bot deleted the sync-context-generic branch September 29, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants