From c6bd33a041824e27c48e6c6ee4c865cd0927d513 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Wed, 23 Aug 2023 01:30:37 +0200 Subject: [PATCH] Put AO back to AwaitUnsafeOnCompleted --- .../System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs index 02a60f50c3867..c3064ad22114b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs @@ -93,6 +93,9 @@ internal static void AwaitUnsafeOnCompleted( AwaitUnsafeOnCompleted(ref awaiter, box); } + // Tier0 codegen for this function may still allocate (while FullOpts won't). + // TODO: remove once https://github.com/dotnet/runtime/issues/90965 is implemented + [MethodImpl(MethodImplOptions.AggressiveOptimization)] internal static void AwaitUnsafeOnCompleted( ref TAwaiter awaiter, IAsyncStateMachineBox box) where TAwaiter : ICriticalNotifyCompletion