Skip to content

Conversation

@Sergio0694
Copy link
Contributor

Closes #31170

This PR adds the following new APIs to the public Unsafe class:

namespace System.Runtime.CompilerServices
{
    public class Unsafe
    {
        public static bool IsNullRef<T>(ref T);
        public static ref T NullRef<T>();
    }
}

cc. @jkotas @GrabYourPitchforks @stephentoub

@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you!

@Sergio0694
Copy link
Contributor Author

Happy to help! Looking forward to the public release with these new APIs! 😊🎉

@GrabYourPitchforks
Copy link
Member

@jkotas @marek-safar Any idea why the mono tests might be segfaulting?

@marek-safar
Copy link
Contributor

It looks like it's hitting some corner case in interpreter implementation. @vargaz could you look into that while @BrzVlad is away?

@GrabYourPitchforks
Copy link
Member

Looks like Jan already beat me to spinning CI back up. ;)

@GrabYourPitchforks GrabYourPitchforks merged commit e671f57 into dotnet:master Jul 29, 2020
@Sergio0694 Sergio0694 deleted the feature/unsafe-isnullref-nullref branch July 29, 2020 08:14
ltrzesniewski added a commit to ltrzesniewski/InlineIL.Fody that referenced this pull request Aug 3, 2020
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API proposal: Unsafe.NullRef, IsNullRef

7 participants