Skip to content

Avoid CoWs #1530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2022
Merged

Avoid CoWs #1530

merged 1 commit into from
Dec 12, 2022

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Dec 12, 2022

We didn't actually avoid a CoW here. We also don't need the 'modifying' workaround; the compiler is smarter now.

We didn't actually avoid a CoW here. We also don't need the 'modifying'
workaround; the compiler is smarter now.
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Dec 12, 2022
/// to `._modifying` allows us to avoid an extra reference to any heap allocated data and
/// therefore avoid a copy on write.
@inlinable
internal mutating func withStateAvoidingCoWs<Action>(_ body: (inout State) -> Action) -> Action {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Well we tried 😛

@glbrntt glbrntt merged commit 524f06b into grpc:main Dec 12, 2022
@glbrntt glbrntt deleted the gb-avoid-cow branch December 12, 2022 10:39
WendellXY pushed a commit to sundayfun/grpc-swift that referenced this pull request Aug 24, 2023
We didn't actually avoid a CoW here. We also don't need the 'modifying'
workaround; the compiler is smarter now.
pinlin168 pushed a commit to sundayfun/grpc-swift that referenced this pull request Aug 24, 2023
We didn't actually avoid a CoW here. We also don't need the 'modifying'
workaround; the compiler is smarter now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants