61 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.Net.Http (4)
System\Net\Http\Headers\HttpHeaders.cs (4)
286if (!Unsafe.IsNullRef(ref storeValueRef)) 773if (Unsafe.IsNullRef(ref storeValueRef)) 788if (!Unsafe.IsNullRef(ref storeValueRef)) 1595return !Unsafe.IsNullRef(ref GetValueRefOrNullRef(key));
System.Net.Sockets (1)
System\Net\Sockets\SocketPal.Unix.cs (1)
212Unsafe.IsNullRef(ref MemoryMarshal.GetReference(buffer)) ? Array.Empty<byte>() : buffer;
System.Numerics.Tensors (2)
System\Numerics\Tensors\netcore\TensorShape.cs (2)
909if (!Unsafe.IsNullRef(in reference)) 931if (!Unsafe.IsNullRef(in 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)); 717if (Unsafe.IsNullRef(ref value)) 754if (!Unsafe.IsNullRef(ref valueRef)) 779if (!Unsafe.IsNullRef(ref valueRef)) 795!Unsafe.IsNullRef(ref FindValue(key, out _)); 1052Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1189Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1445if (!Unsafe.IsNullRef(ref valRef)) 1651if (!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)
62if (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))) 109if (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))) 142if (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 (3)
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
40if (!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(password)))
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
77return Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span));
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (1)
127if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(password)))
System.Security.Cryptography.Pkcs (2)
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
77return Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span));
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (1)
127if (Unsafe.IsNullRef(ref MemoryMarshal.GetReference(password)))