internal static bool IsPinnable(object obj) { if (obj == null) { return(true); } Type type = obj.GetType(); return(!type.IsValueType || RuntimeTypeHandle.HasReferences(type as RuntimeType)); }
internal static bool IsPinnable(object?obj) { if (obj == null || obj is string) { return(true); } var type = (obj.GetType() as RuntimeType) !; return(!RuntimeTypeHandle.HasReferences(type)); }
// This is implemented as a JIT intrinsic public static bool IsReferenceOrContainsReferences <T>() { return(!typeof(T).IsValueType || RuntimeTypeHandle.HasReferences((typeof(T) as RuntimeType))); }
internal static bool ObjectHasReferences(object obj) { return(RuntimeTypeHandle.HasReferences(obj.GetType() as RuntimeType)); }
internal static bool IsPinnable(object obj) { return(obj == null || RuntimeTypeHandle.HasReferences(obj.GetType() as RuntimeType)); }