Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit dc0d072

Browse files
benaadamsjkotas
authored andcommitted
Avoid boxing allocations for async in Tier0 (#22984)
1 parent ecf92d0 commit dc0d072

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/System.Private.CoreLib/shared/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)