.Net 4.6 RC Diff

So its been a while since I last did a framework surface diff, but it seems my program still works.  This time I diffed 4.6 RC vs 4.5.1.

A few small things, but hiding in the middle is a bunch of new classes in System.Numerics which is nice.

As usual this list is not complete, I skip things which I don’t think are worth mentioning.  But that isn’t many things this time.

  • System.Array.Empty<T>() – does what it says on the box.
  • System.Buffer.MemoryCopy – like BlockCopy, but for raw memory pointers rather than arrays.
  • Usual set of SQL Server database connection additions – column encryption, authentication types.
  • DateTimeOffset supports conversion to/from unix time in seconds/milliseconds.
  • System.Diagnostics.ProcessStartInfo now has an Environment property.  Not sure what it does yet, given there is already the EnvironmentVariables property.
  • Bunch of Event tracing stuff I have no idea about…
  • System.FormattableString – seems to bunch a format string and its arguments together – but has no public constructor… But there is a static create method on System.Runtime.CompilerServices.FormattableStringFactory.
  • System.GC – new ‘no GC’ region methods which ensure there is enough memory before they start.  Can also force a small object heap compaction.
  • System.Globalization.CompareInfo.GetHashCode – can get a culture specific hashcode.
  • System.IO.MemoryStream.TryGetBuffer – can get back an array segment when memory stream is constructed with offset/length.
  • Async methods for NamedPipeStream connection.
  • Async methods for read/write/flush on UnmanagedMemoryStream
  • Socket options for reusing ports.
  • System Numerics adds Matrix3x2, Matrix4x4, Plane, Quaternion, Vector2, Vector3, Vector4.  They are unfortunately all single precision, but the reasoning is justified – they are all hardware accelerated using SIMD.  Interestingly the pre-release 4.6 documentation appears newer than the actual released code here.  It documents many useful static methods which are not yet in the actual library.  Also there is apparently a System.Vector<T> coming which works for any primitive type T, with a maximum rank dependent on SIMD register width.
  • New assembly level attribute – DisablePrivateReflection – apparently does what it says…
  • Asymmetric padding mode options for crypto.  CNG supports RSA.  Crypto random number generator can write random values to a subset of an array.
  • WindowsIdentity.RunImpersonated – can now execute a delegate rather than having to set up an impersonation context.
  • string.Format with format provider now has the small arg count optimization of explicit methods for 1 2 and 3 format args.
  • System.Encoding has dropped default support for code page based encodings, you have to manually call RegisterProvider to have them supported??
  • System.Encoding has a GetString which takes a byte pointer and length rather than just an array.
  • StringBuilder has an Append which takes a char pointer and length rather than just an array.  Also small arg count optimization with AppendFormat with format provider.
  • System.Threading.AsyncLocal – interesting, not 100% clear what it does yet, but it sounds like thread local variables except with a value per ‘async flow’ rather than per thread.
  • Task creation methods for immediate cancelled/exception states.
  • Extension methods to get a safe wait handle given a wait handle.
  • System.Uri.IdnHost – can get punycode version of international domain names.
  • WPF diagnostics hook event for visible tree changes.
  • System.Xml.XmlNode gets a PreviousText property.

Leave a Reply

Your email address will not be published. Required fields are marked *