-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Experiment with compiler support for nint and nuint **NOMERGE** #36158
Conversation
Tagging subscribers to this area: @ViktorHofer |
Did you run into any gotchas with deleting aliases for |
@@ -10,11 +10,11 @@ | |||
|
|||
#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types | |||
#if TARGET_64BIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why this isn't testing things by just removing these aliases? I'd expect us to be able to just remove all of the usings and have things "just work"
If they don't, its likely a compiler bug we should flag @cston on and otherwise, we should be generally good to check things in.
The compiler just uses the built-in IL operators after all and we were already using aliases of the right size....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a shot: #36159 . Some places needed an extra unsafe or cast, but it was pretty straightforward otherwise.
I didn't remove the aliases straight-up because I anticipated there might be problems at |
There should not be any (for CoreCLR at least). https://github.com/dotnet/runtime/blob/master/src/coreclr/src/vm/mscorlib.h does not have any 64-bit ifdefs. |
We now have a compiler toolchain that supports
nint
andnuint
natively.The remaining
nint
/nuint
usages inSpan<T>
andReadOnlySpan<T>
are using the compiler shortcuts forIntPtr
andUIntPtr
. I created some experimental overloads of APIs inBuffer
andUnsafe
to act as the targets.This is not intended to represent production code and will not be committed.
It is meant to exercise CI code paths to see if anything falls over unexpectedly on other architectures.