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