GetMemory/GetSpan takes a minimum size (dotnet/corefx#35186)
authorDavid Fowler <davidfowl@gmail.com>
Sat, 9 Feb 2019 01:40:42 +0000 (17:40 -0800)
committerGitHub <noreply@github.com>
Sat, 9 Feb 2019 01:40:42 +0000 (17:40 -0800)
commit95702c8bebe365cd99b30087c578abe1cb2f330e
treee6fa5a9bf8676323a1d46ba1a5883ea3115c9435
parent8ec5a72b49d44274becd9aea7a4db9eda39ad206
GetMemory/GetSpan takes a minimum size (dotnet/corefx#35186)

- We changed the contract of IBufferWriter to be more usable by making the sizeHint a minimum size. If the caller requests memory over the max pool size then we allocate.
- In the default case where we're using the shared array pool, we let the underlying pool handle this (it does internally).

Commit migrated from https://github.com/dotnet/corefx/commit/c45d88d5a1326501e31c02e508efb352a492fb59
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/BufferSegment.cs
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs
src/libraries/System.IO.Pipelines/tests/PipePoolTests.cs
src/libraries/System.IO.Pipelines/tests/PipePoolTests.nonnetstandard.cs [new file with mode: 0644]
src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs
src/libraries/System.IO.Pipelines/tests/System.IO.Pipelines.Tests.csproj