Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Shorten the name of the buffer-checking method.
  • Loading branch information
teo-tsirpanis authored and github-actions committed Aug 31, 2021
commit 81973cb01d1c034c076ba978315be40abfbd718c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ private static ValueTask<long> ReadScatterAtOffsetAsync(SafeFileHandle handle, I
}

if (CanUseScatterGatherWindowsAPIs(handle)
&& TryPrepareBuffersForScatterGatherWindowsAPIs(buffers, default(MemoryHandler), out MemoryHandle[]? pinnedBuffers, out int totalBytes))
&& TryPrepareScatterGatherBuffers(buffers, default(MemoryHandler), out MemoryHandle[]? pinnedBuffers, out int totalBytes))
{
try
{
Expand Down Expand Up @@ -490,9 +490,9 @@ private static bool CanUseScatterGatherWindowsAPIs(SafeFileHandle handle)
// 2. exactly one page long each (our own requirement to prevent partial reads)
// 3. not bigger than 2^32 - 1 in total
// This function is also responsible for pinning the buffers if they
// are suitable and they must be unpinned after the I/O operation.
// are suitable and they must be unpinned after the I/O operation completes.
// The total size of the buffers is also returned.
private static bool TryPrepareBuffersForScatterGatherWindowsAPIs<T, THandler>(IReadOnlyList<T> buffers,
private static bool TryPrepareScatterGatherBuffers<T, THandler>(IReadOnlyList<T> buffers,
THandler handler, [NotNullWhen(true)] out MemoryHandle[]? pinnedBuffers, out int totalBytes)
where THandler: struct, IMemoryHandler<T>
{
Expand Down Expand Up @@ -676,7 +676,7 @@ private static ValueTask WriteGatherAtOffsetAsync(SafeFileHandle handle, IReadOn
}

if (CanUseScatterGatherWindowsAPIs(handle)
&& TryPrepareBuffersForScatterGatherWindowsAPIs(buffers, default(ReadOnlyMemoryHandler), out MemoryHandle[]? pinnedBuffers, out int totalBytes))
&& TryPrepareScatterGatherBuffers(buffers, default(ReadOnlyMemoryHandler), out MemoryHandle[]? pinnedBuffers, out int totalBytes))
{
try
{
Expand Down