private static bool IsValueWriteAtomicCalculate()

in rd-net/Lifetimes/Util/GenericUtil.cs [9:34]


  private static bool IsValueWriteAtomicCalculate()
  {
    var type = typeof (T);
    if (type.IsClass)
      return true;
    
    switch (Type.GetTypeCode(type))
    {
      case TypeCode.Boolean:
      case TypeCode.Char:
      case TypeCode.SByte:
      case TypeCode.Byte:
      case TypeCode.Int16:
      case TypeCode.UInt16:
      case TypeCode.Int32:
      case TypeCode.UInt32:
      case TypeCode.Single:
        return true;
      case TypeCode.Int64:
      case TypeCode.UInt64:
      case TypeCode.Double:
        return IntPtr.Size == 8;
      default:
        return false;
    }
  }