diff --git a/cs/src/core/Utilities/Utility.cs b/cs/src/core/Utilities/Utility.cs index 2d2986a24..a1d74edfc 100644 --- a/cs/src/core/Utilities/Utility.cs +++ b/cs/src/core/Utilities/Utility.cs @@ -142,6 +142,10 @@ internal static string PrettySize(long value) /// internal static bool IsBlittable() { +#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER + return !RuntimeHelpers.IsReferenceOrContainsReferences(); +#else + if (default(T) == null) return false; @@ -156,6 +160,7 @@ internal static bool IsBlittable() return false; } return true; +#endif } ///