use PoolingAsyncValueTaskMethodBuilder in BufferedFileStreamStrategy (#56095)
authorAdam Sitnik <adam.sitnik@gmail.com>
Thu, 22 Jul 2021 07:13:57 +0000 (09:13 +0200)
committerGitHub <noreply@github.com>
Thu, 22 Jul 2021 07:13:57 +0000 (09:13 +0200)
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/BufferedFileStreamStrategy.cs

index 9aaa16f..00d0d2a 100644 (file)
@@ -423,6 +423,7 @@ namespace System.IO.Strategies
             }
         }
 
+        [AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder<>))]
         private async ValueTask<int> ReadAsyncSlowPath(Task semaphoreLockTask, Memory<byte> buffer, CancellationToken cancellationToken)
         {
             Debug.Assert(_asyncActiveSemaphore != null);
@@ -705,6 +706,7 @@ namespace System.IO.Strategies
             }
         }
 
+        [AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder))]
         private async ValueTask WriteAsyncSlowPath(Task semaphoreLockTask, ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
         {
             Debug.Assert(_asyncActiveSemaphore != null);