(Type type)
| 304 | } |
| 305 | |
| 306 | internal static bool IsBlittable(Type type) |
| 307 | { |
| 308 | if (type.IsPrimitive || type.IsEnum) |
| 309 | return true; |
| 310 | if (type.IsArray && IsBlittable(type.GetElementType())) |
| 311 | return true; |
| 312 | if (type.IsPointer && type.HasElementType && type.GetElementType().IsPrimitive) |
| 313 | return true; |
| 314 | if (type.IsClass) |
| 315 | return false; |
| 316 | if (type.IsValueType) |
| 317 | { |
| 318 | var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); |
| 319 | foreach (FieldInfo field in fields) |
| 320 | { |
| 321 | if (!IsBlittable(field.FieldType)) |
| 322 | return false; |
| 323 | } |
| 324 | } |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | /// <summary> |
| 329 | /// Returns blittable internal type for given type. |
nothing calls this directly
no test coverage detected