Beispiel #1
0
        internal static bool IsPinnable(object obj)
        {
            if (obj == null)
            {
                return(true);
            }
            Type type = obj.GetType();

            return(!type.IsValueType || RuntimeTypeHandle.HasReferences(type as RuntimeType));
        }
Beispiel #2
0
        internal static bool IsPinnable(object?obj)
        {
            if (obj == null || obj is string)
            {
                return(true);
            }
            var type = (obj.GetType() as RuntimeType) !;

            return(!RuntimeTypeHandle.HasReferences(type));
        }
Beispiel #3
0
 // This is implemented as a JIT intrinsic
 public static bool IsReferenceOrContainsReferences <T>()
 {
     return(!typeof(T).IsValueType || RuntimeTypeHandle.HasReferences((typeof(T) as RuntimeType)));
 }
Beispiel #4
0
 internal static bool ObjectHasReferences(object obj)
 {
     return(RuntimeTypeHandle.HasReferences(obj.GetType() as RuntimeType));
 }
Beispiel #5
0
 internal static bool IsPinnable(object obj)
 {
     return(obj == null || RuntimeTypeHandle.HasReferences(obj.GetType() as RuntimeType));
 }