Use C# compiler provided nint/nuint#36159
Conversation
src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs
Show resolved
Hide resolved
|
Is it safe to use |
Yes, the tests caught it too |
|
Just to confirm, it should not be a breaking change if in the future we decide to change APIs like |
|
Does it make |
Corelib still has other ifdefs and compilation switches for endianness and ARM/ARM64 vs x86/x64 intrinsics at the very least |
It also uses it for some of the memory copy/set methods and the IntPtr/UIntPtr implementations |
It would not be a binary breaking change. I suspect that it may be a source breaking change in some rare cases. |
| return ref Unsafe.AddByteOffset(ref DangerousGetMutableReference(), index); | ||
| #else | ||
| return ref Unsafe.AddByteOffset(ref DangerousGetMutableReference(), (IntPtr)index); | ||
| return ref Unsafe.AddByteOffset(ref DangerousGetMutableReference(), (nint)index); |
There was a problem hiding this comment.
I think the whole #if can be removed here now. I can do that in a follow up.
Would changing a return value or |
|
Seems like a good example of the possible source breaking changes Jan alluded to. But you'd have to retarget + recompile your app to see the breaks. The |
wouldn't changing an |
No description provided.