Files
2026-08-27 10:56:38 -06:00

19 lines
429 B
C#

using System.Runtime.CompilerServices;
namespace Microsoft.CodeAnalysis.Collections.Internal;
internal static class RoslynUnsafe
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static ref T NullRef<T>()
{
return ref Unsafe.AsRef<T>(null);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static bool IsNullRef<T>(ref T source)
{
return Unsafe.AsPointer(in source) == null;
}
}