diff --git a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml index a999cbb20eb7..d9801d4788ca 100644 --- a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml +++ b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml @@ -112,9 +112,6 @@ - - - diff --git a/tracer/src/Datadog.Trace/HttpOverStreams/ChunkedEncodingReadStream.cs b/tracer/src/Datadog.Trace/HttpOverStreams/ChunkedEncodingReadStream.cs index 05aaf444a6a4..94fc17403b08 100644 --- a/tracer/src/Datadog.Trace/HttpOverStreams/ChunkedEncodingReadStream.cs +++ b/tracer/src/Datadog.Trace/HttpOverStreams/ChunkedEncodingReadStream.cs @@ -13,12 +13,6 @@ using System.Threading.Tasks; using Datadog.Trace.Util.Streams; -#if NETCOREAPP -using ArrayPool = System.Buffers.ArrayPool; -#else -using ArrayPool = Datadog.Trace.VendoredMicrosoftCode.System.Buffers.ArrayPool; -#endif - namespace Datadog.Trace.HttpOverStreams; internal sealed partial class ChunkedEncodingReadStream : DelegatingStream @@ -45,8 +39,6 @@ internal sealed partial class ChunkedEncodingReadStream : DelegatingStream 128; #endif - private static readonly ArrayPool Pool = ArrayPool.Shared; - private readonly Stream _innerStream; private readonly byte[] _streamBuffer; private ulong _bytesRemainingInChunk; @@ -63,7 +55,7 @@ public ChunkedEncodingReadStream(Stream innerStream) _innerStream = innerStream; // We use a buffer that is double the size of the read buffer, so that we can move // the bytes around if we end up hitting edge cases - _streamBuffer = Pool.Rent(ReadBufferSize * 2); + _streamBuffer = new byte[ReadBufferSize * 2]; _currentPosition = new(offset: 0, count: 0); } @@ -77,20 +69,6 @@ private enum ParsingState : byte Done } - protected override void Dispose(bool disposing) - { - Pool.Return(_streamBuffer); - base.Dispose(disposing); - } - -#if NETCOREAPP - public override ValueTask DisposeAsync() - { - Pool.Return(_streamBuffer); - return base.DisposeAsync(); - } -#endif - // This is not called by our production code, so we're yolo-ing it // MockTracerAgent currently _does_ use this code path public override int Read(byte[] buffer, int offset, int count) diff --git a/tracer/test/Datadog.Trace.Tests/Snapshots/PublicApiTests.Datadog.Trace.AssemblyReferencesHaveNotChanged.netcoreapp3.1.verified.txt b/tracer/test/Datadog.Trace.Tests/Snapshots/PublicApiTests.Datadog.Trace.AssemblyReferencesHaveNotChanged.netcoreapp3.1.verified.txt index dbd865b232a2..91a380e224cb 100644 --- a/tracer/test/Datadog.Trace.Tests/Snapshots/PublicApiTests.Datadog.Trace.AssemblyReferencesHaveNotChanged.netcoreapp3.1.verified.txt +++ b/tracer/test/Datadog.Trace.Tests/Snapshots/PublicApiTests.Datadog.Trace.AssemblyReferencesHaveNotChanged.netcoreapp3.1.verified.txt @@ -6,7 +6,6 @@ Microsoft.AspNetCore.Routing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a Microsoft.AspNetCore.Routing.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 Microsoft.Extensions.Primitives, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 Microsoft.Net.Http.Headers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 -System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Collections, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a System.Collections.Concurrent, Version=4.0.15.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a System.Collections.NonGeneric, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a