53 references to IsNullRef
Microsoft.AspNetCore.OutputCaching (2)
FormatterBinaryWriter.cs (2)
47if (Unsafe.IsNullRef(ref root)) 125if (!Unsafe.IsNullRef(ref root))
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
154if (Unsafe.IsNullRef(ref valueRef)) 174if (Unsafe.IsNullRef(ref valueRef))
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
154if (Unsafe.IsNullRef(ref valueRef)) 174if (Unsafe.IsNullRef(ref valueRef))
Microsoft.CodeAnalysis.UnitTests (6)
Collections\SegmentedCollectionsMarshalTests.cs (6)
67Assert.True(Unsafe.IsNullRef(ref SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3))); 123Assert.True(Unsafe.IsNullRef(ref SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3))); 202Assert.True(Unsafe.IsNullRef(ref Unsafe.AsRef(in SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3)))); 249Assert.True(Unsafe.IsNullRef(ref Unsafe.AsRef(in SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3)))); 303Assert.True(Unsafe.IsNullRef(ref SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3))); 357Assert.True(Unsafe.IsNullRef(ref SegmentedCollectionsMarshal.GetValueRefOrNullRef(dict, 3)));
System.Collections.Immutable (7)
System\Collections\Frozen\FrozenDictionary.AlternateLookup.cs (3)
107if (Unsafe.IsNullRef(in valueRef)) 121!Unsafe.IsNullRef(in _alternateLookupDelegate(Dictionary, key)); 135if (!Unsafe.IsNullRef(in valueRef))
System\Collections\Frozen\FrozenDictionary.cs (4)
490/// <remarks>The null reference can be detected by calling <see cref="Unsafe.IsNullRef"/>.</remarks> 567if (Unsafe.IsNullRef(ref Unsafe.AsRef(in valueRef))) 591!Unsafe.IsNullRef(ref Unsafe.AsRef(in GetValueRefOrNullRef(key))); 616if (!Unsafe.IsNullRef(ref Unsafe.AsRef(in valueRef)))
System.Numerics.Tensors (2)
System\Numerics\Tensors\netcore\TensorShape.cs (2)
914if (!Unsafe.IsNullRef(ref reference)) 936if (!Unsafe.IsNullRef(ref reference))
System.Private.CoreLib (30)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (12)
233if (!Unsafe.IsNullRef(ref value)) 260if (!Unsafe.IsNullRef(ref value) && EqualityComparer<TValue>.Default.Equals(value, keyValuePair.Value)) 271if (!Unsafe.IsNullRef(ref value) && EqualityComparer<TValue>.Default.Equals(value, keyValuePair.Value)) 298!Unsafe.IsNullRef(ref FindValue(key)); 716if (Unsafe.IsNullRef(ref value)) 753if (!Unsafe.IsNullRef(ref valueRef)) 778if (!Unsafe.IsNullRef(ref valueRef)) 794!Unsafe.IsNullRef(ref FindValue(key, out _)); 1051Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1188Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1444if (!Unsafe.IsNullRef(ref valRef)) 1650if (!Unsafe.IsNullRef(ref value))
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (2)
606public bool Contains(TAlternate item) => !Unsafe.IsNullRef(in FindValue(item)); 615if (!Unsafe.IsNullRef(in value))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
2833if (Unsafe.IsNullRef(ref eventMeta)) return false; 3342if (!Unsafe.IsNullRef(ref startEventMetadata))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.cs (1)
55if (Unsafe.IsNullRef(ref metadata))
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (2)
367Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span1))); 368Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span2)));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
44if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(managed))) 104if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(managed)))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
38if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(managed))) 132if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(managed)))
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (1)
1238Debug.Assert(!Unsafe.IsNullRef(ref separator));
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
78internal bool IsNull => Unsafe.IsNullRef(ref _value) && _type == IntPtr.Zero;
src\System\RuntimeHandles.cs (2)
1556Debug.Assert(!Unsafe.IsNullRef(ref fieldDataRef.Get())); 1563Debug.Assert(!Unsafe.IsNullRef(ref target));
src\System\StubHelpers.cs (1)
510if (Unsafe.IsNullRef(ref cleanupWorkList))
src\System\Threading\Interlocked.CoreCLR.cs (2)
97if (Unsafe.IsNullRef(ref location1)) 163if (Unsafe.IsNullRef(ref location1))
System.Security.Cryptography.Pkcs (2)
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
69return Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span));
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (1)
127if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(password)))