Implement and use MultiArrayBuffer (#44980)
authorGeoff Kizer <geoffrek@microsoft.com>
Wed, 6 Jan 2021 19:06:15 +0000 (11:06 -0800)
committerGitHub <noreply@github.com>
Wed, 6 Jan 2021 19:06:15 +0000 (11:06 -0800)
commitd448461805e68566a33611acccf7589dad73976a
treeda4f6452c8ccc704ff68c47ab20f4fff7dd8ea48
parentae1f760dd839ff50e4310550687e8376efc63c08
Implement and use MultiArrayBuffer (#44980)

* add MultiArrayBuffer and use in StreamBuffer and Http2Stream

* rework EnsureAvailableSpace and add tests for it

* make dispose handling more robust, plus minor tweaks

* add AssertExtensions.SequenceEqual for providing more useful information about sequence differences, and use in StreamConformanceTests

* tweaks

* replace _blockCount with _allocatedEnd

* use uint instead of int internally to assure bitop optimizations

* fix _allocatedEnd calculation

* address PR feedback

* more PR feedback and some minor fixes/improvements

* small test improvements

* Apply suggestions from code review

Co-authored-by: Günther Foidl <gue@korporal.at>
* address review feedback

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Günther Foidl <gue@korporal.at>
24 files changed:
src/libraries/Common/src/System/Net/MultiArrayBuffer.cs [new file with mode: 0644]
src/libraries/Common/src/System/Net/StreamBuffer.cs
src/libraries/Common/tests/Common.Tests.csproj
src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs
src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs
src/libraries/Common/tests/Tests/System/Net/MultiArrayBufferTests.cs [new file with mode: 0644]
src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj
src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj
src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
src/libraries/System.IO.Pipelines/tests/System.IO.Pipelines.Tests.csproj
src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
src/libraries/System.IO.UnmanagedMemoryStream/tests/System.IO.UnmanagedMemoryStream.Tests.csproj
src/libraries/System.IO/tests/System.IO.Tests.csproj
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs
src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj
src/libraries/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj
src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj
src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj
src/libraries/System.Security.Cryptography.Primitives/tests/System.Security.Cryptography.Primitives.Tests.csproj
src/libraries/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj