You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our default interpolated string handler, StringBuilder handler, and MemoryExtensions handler are all passed to their target methods by ref. But we neglected to do so for the Debug handlers; we should update those signatures as well.
Benefits:
Consistency across all our handlers
These are typically larger structs and so by ref helps (though it doesn’t matter for Debug)
Making it a ref makes it even less attractive to try to call directly / makes it look even more special
It gives us the opportunity to more safely clean up at the end of the operation
Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.
Issue Details
Background and motivation
Our default interpolated string handler, StringBuilder handler, and MemoryExtensions handler are all passed to their target methods by ref. But we neglected to do so for the Debug handlers; we should update those signatures as well.
Benefits:
Consistency across all our handlers
These are typically larger structs and so by ref helps (though it doesn’t matter for Debug)
Making it a ref makes it even less attractive to try to call directly / makes it look even more special
It gives us the opportunity to more safely clean up at the end of the operation
Looks good as proposed. Hopefully we'll be diligent in the future at always using pass-by-ref when the handler is a struct.
bartonjs
added
api-approved
API was approved in API review, it can be implemented
and removed
blocking
Marks issues that we want to fast track in order to unblock other important work
api-ready-for-review
API is ready for review, it is NOT ready for implementation
labels
Aug 17, 2021
Background and motivation
Our default interpolated string handler, StringBuilder handler, and MemoryExtensions handler are all passed to their target methods by ref. But we neglected to do so for the Debug handlers; we should update those signatures as well.
Benefits:
API Proposal
See the ref updates here:
https://github.com/dotnet/runtime/pull/57536/files#diff-cec8e6f471b4193246bdc0107b0dd7cbe131fb7fd189b288b37269c333d1171d
API Usage
No usage difference when using interpolated string syntax, which is how we expect these APIs to be used.
Risks
This is a breaking change from .NET 6 Preview 7.
The text was updated successfully, but these errors were encountered: