Remove unsafe code from Guid.TryFormat#121652
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime |
| internal bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, int flags) | ||
| where TChar : unmanaged, IUtfChar<TChar> | ||
| { | ||
| Span<TChar> dest = destination; |
There was a problem hiding this comment.
Is there a tracking issue for the need to cache this in a local?
There was a problem hiding this comment.
Not sure, I didn't want to advertise it as a hack, it should be fixed by removing the old struct promotion eventually
There was a problem hiding this comment.
As far as "hacks" go, this one is probably one of the safest/simplest ones. Certainly better than using Unsafe.Add and friends.
I think it's better to explicitly track this so we know when we can remove it, so users can use it to avoid unsafe code themselves, and so users can know when they can remove their own workarounds.
|
@EgorBo were you planning on finishing this? I think it was mostly good to go, right? |
Right, it's just that I wanted to land a few bounds-check related JIT opt first to assist it (work-in-progress) |
|
Will get back to it later |
No description provided.