Skip to content

Commit 34a1db0

Browse files
benaadamsdotnet-bot
authored andcommitted
Avoid boxing allocations for async in Tier0 (dotnet/coreclr#22984)
Signed-off-by: dotnet-bot <[email protected]>
1 parent 535650f commit 34a1db0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Common/src/CoreLib/System/Runtime/CompilerServices/AsyncMethodBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ public void AwaitOnCompleted<TAwaiter, TStateMachine>(
399399
/// <typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam>
400400
/// <param name="awaiter">The awaiter.</param>
401401
/// <param name="stateMachine">The state machine.</param>
402+
// AggressiveOptimization to workaround boxing allocations in Tier0 until: https://github.com/dotnet/coreclr/issues/14474
403+
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
402404
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(
403405
ref TAwaiter awaiter, ref TStateMachine stateMachine)
404406
where TAwaiter : ICriticalNotifyCompletion

0 commit comments

Comments
 (0)