Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's new in .NET 6 RC1 [WIP] #6569

Closed
leecow opened this issue Aug 11, 2021 · 3 comments
Closed

What's new in .NET 6 RC1 [WIP] #6569

leecow opened this issue Aug 11, 2021 · 3 comments

Comments

@leecow
Copy link
Member

leecow commented Aug 11, 2021

What's new in .NET 6 RC1

This issue is for teams to highlight work for the community that will release .NET 6 RC1

To add content, use a new conversation entry. The entry should include the team name and feature title as the first line as shown in the template below.

## Team Name: Feature title

[link to the tracking issue or epic item for the work]

Tell the story of the feature and anything the community should pay particular attention 
to be successful using the feature.

Preview 1: #5853
Preview 2: #5889
Preview 3: #5890
Preview 4: #6098
Preview 5: #6099
Preview 6: #6325
Preview 7: #6444

@Sergio0694
Copy link

DependentHandle is now public with streamlined APIs

Sharing this here as suggested by @GrabYourPitchforks, as it was missed in the previous posts for .NET 6 Preview 7. The DependentHandle type is public in .NET 6 (as per dotnet/runtime#54246), with the following API surface:

namespace System.Runtime
{
    public struct DependentHandle : IDisposable
    {
        public DependentHandle(object? target, object? dependent);
        public bool IsAllocated { get; }
        public object? Target { get; set; }
        public object? Dependent { get; set; }
        public (object? Target, object? Dependent) TargetAndDependent { get; }
        public void Dispose();
    }
}

It can be used by (advanced) developers to eg. implement custom caching systems, as well as customized versions of the ConditionalWeakTable<TKey, TValue> type. For instance, it will be used by the WeakReferenceMessenger type in the MVVM Toolkit to avoid memory allocations when broadcasting messages (due to no CWT<K, V>.Enumerator allocations necessary) 🚀

@teo-tsirpanis
Copy link
Contributor

HMAC one-shot methods (dotnet/runtime#40012)

Like the previous entry, this was missed for .NET 6 Preview 6.

The System.Security.Cryptography HMAC classes got some static methods that allow one-shot calculation of HMACs without allocations, similar to the one-shot methods of hashes that were added in a previous release.

namespace System.Security.Cryptography {
    public partial class HMACMD5 {
        public static byte[] HashData(byte[] key, byte[] source) => throw null;
        public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) => throw null;
        public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) => throw null;
        public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => throw null;
    }

    public partial class HMACSHA1 {
        public static byte[] HashData(byte[] key, byte[] source) => throw null;
        public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) => throw null;
        public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) => throw null;
        public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => throw null;
    }

    public partial class HMACSHA256 {
        public static byte[] HashData(byte[] key, byte[] source) => throw null;
        public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) => throw null;
        public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) => throw null;
        public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => throw null;
    }

    public partial class HMACSHA384 {
        public static byte[] HashData(byte[] key, byte[] source) => throw null;
        public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) => throw null;
        public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) => throw null;
        public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => throw null;
    }

    public partial class HMACSHA512 {
        public static byte[] HashData(byte[] key, byte[] source) => throw null;
        public static byte[] HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) => throw null;
        public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) => throw null;
        public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => throw null;
    }
}

@kouvel
Copy link
Member

kouvel commented Sep 10, 2021

.NET 6 compatibility with Intel CET shadow stacks (early preview on Windows)

.NET 6 compatibility with Intel CET shadow stacks is available to try as an early preview from RC1 on Windows for x64 applications. Interested early adopters are encouraged to try it out by opting in at an application level (requires a processor supporting CET and a preview build of Windows), see the link for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants