Put AO back to AwaitUnsafeOnCompleted (#90980)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 23 Aug 2023 21:36:46 +0000 (14:36 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Aug 2023 21:36:46 +0000 (14:36 -0700)
Co-authored-by: EgorBo <egorbo@gmail.com>
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs

index 02a60f5..c3064ad 100644 (file)
@@ -93,6 +93,9 @@ namespace System.Runtime.CompilerServices
             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<TAwaiter>(
             ref TAwaiter awaiter, IAsyncStateMachineBox box)
             where TAwaiter : ICriticalNotifyCompletion