Skip to content

Commit 8f56489

Browse files
authored
Rename SlabMemoryPool #31609 (#31752)
1 parent 5eda8d4 commit 8f56489

37 files changed

+63
-63
lines changed

src/Servers/HttpSys/src/HttpSysListener.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ internal partial class HttpSysListener : IDisposable
2020
{
2121
// Win8# 559317 fixed a bug in Http.sys's HttpReceiveClientCertificate method.
2222
// Without this fix IOCP callbacks were not being called although ERROR_IO_PENDING was
23-
// returned from HttpReceiveClientCertificate when using the
23+
// returned from HttpReceiveClientCertificate when using the
2424
// FileCompletionNotificationModes.SkipCompletionPortOnSuccess flag.
2525
// This bug was only hit when the buffer passed into HttpReceiveClientCertificate
2626
// (1500 bytes initially) is too small for the certificate.
2727
// Due to this bug in downlevel operating systems the FileCompletionNotificationModes.SkipCompletionPortOnSuccess
2828
// flag is only used on Win8 and later.
2929
internal static readonly bool SkipIOCPCallbackOnSuccess = ComNetOS.IsWin8orLater;
3030

31-
// Mitigate potential DOS attacks by limiting the number of unknown headers we accept. Numerous header names
32-
// with hash collisions will cause the server to consume excess CPU. 1000 headers limits CPU time to under
31+
// Mitigate potential DOS attacks by limiting the number of unknown headers we accept. Numerous header names
32+
// with hash collisions will cause the server to consume excess CPU. 1000 headers limits CPU time to under
3333
// 0.5 seconds per request. Respond with a 400 Bad Request.
3434
private const int UnknownHeaderLimit = 1000;
3535

36-
internal MemoryPool<byte> MemoryPool { get; } = SlabMemoryPoolFactory.Create();
36+
internal MemoryPool<byte> MemoryPool { get; } = PinnedBlockMemoryPoolFactory.Create();
3737

3838
private volatile State _state; // m_State is set only within lock blocks, but often read outside locks.
3939

src/Servers/IIS/IIS/src/Core/IISHttpServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal class IISHttpServer : IServer
2323
private const string WebSocketVersionString = "WEBSOCKET_VERSION";
2424

2525
private IISContextFactory? _iisContextFactory;
26-
private readonly MemoryPool<byte> _memoryPool = new SlabMemoryPool();
26+
private readonly MemoryPool<byte> _memoryPool = new PinnedBlockMemoryPool();
2727
private GCHandle _httpServerHandle;
2828
private readonly IHostApplicationLifetime _applicationLifetime;
2929
private readonly ILogger<IISHttpServer> _logger;

src/Servers/Kestrel/Core/test/ConcurrentPipeWriterTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class ConcurrentPipeWriterTests
1616
[Fact]
1717
public async Task PassthroughIfAllFlushesAreAwaited()
1818
{
19-
using (var slabPool = new SlabMemoryPool())
20-
using (var diagnosticPool = new DiagnosticMemoryPool(slabPool))
19+
using (var memoryPool = new PinnedBlockMemoryPool())
20+
using (var diagnosticPool = new DiagnosticMemoryPool(memoryPool))
2121
{
2222
var pipeWriterFlushTcsArray = new[] {
2323
new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously),
@@ -79,8 +79,8 @@ public async Task PassthroughIfAllFlushesAreAwaited()
7979
[Fact]
8080
public async Task QueuesIfFlushIsNotAwaited()
8181
{
82-
using (var slabPool = new SlabMemoryPool())
83-
using (var diagnosticPool = new DiagnosticMemoryPool(slabPool))
82+
using (var memoryPool = new PinnedBlockMemoryPool())
83+
using (var diagnosticPool = new DiagnosticMemoryPool(memoryPool))
8484
{
8585
var pipeWriterFlushTcsArray = new[] {
8686
new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously),
@@ -177,8 +177,8 @@ public async Task QueuesIfFlushIsNotAwaited()
177177
[Fact]
178178
public async Task KeepsQueueIfInnerFlushFinishesBetweenGetMemoryAndAdvance()
179179
{
180-
using (var slabPool = new SlabMemoryPool())
181-
using (var diagnosticPool = new DiagnosticMemoryPool(slabPool))
180+
using (var memoryPool = new PinnedBlockMemoryPool())
181+
using (var diagnosticPool = new DiagnosticMemoryPool(memoryPool))
182182
{
183183
var pipeWriterFlushTcsArray = new[] {
184184
new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously),
@@ -229,7 +229,7 @@ public async Task KeepsQueueIfInnerFlushFinishesBetweenGetMemoryAndAdvance()
229229
}
230230

231231
// Now that we flushed the ConcurrentPipeWriter again, the GetMemory() and Advance() calls are replayed.
232-
// Make sure that MockPipeWriter.SlabMemoryPoolBlockSize matches SlabMemoryPool._blockSize or else
232+
// Make sure that MockPipeWriter.PinnedBlockMemoryPoolBlockSize matches PinnedBlockMemoryPool._blockSize or else
233233
// it might take more or less calls to the inner PipeWriter's GetMemory method to copy all the data.
234234
Assert.Equal(3, mockPipeWriter.GetMemoryCallCount);
235235
Assert.Equal(3, mockPipeWriter.AdvanceCallCount);
@@ -261,8 +261,8 @@ public async Task KeepsQueueIfInnerFlushFinishesBetweenGetMemoryAndAdvance()
261261
[Fact]
262262
public async Task CompleteFlushesQueuedBytes()
263263
{
264-
using (var slabPool = new SlabMemoryPool())
265-
using (var diagnosticPool = new DiagnosticMemoryPool(slabPool))
264+
using (var memoryPool = new PinnedBlockMemoryPool())
265+
using (var diagnosticPool = new DiagnosticMemoryPool(memoryPool))
266266
{
267267
var pipeWriterFlushTcsArray = new[] {
268268
new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously),
@@ -317,7 +317,7 @@ public async Task CompleteFlushesQueuedBytes()
317317
await completeTask.DefaultTimeout();
318318

319319
// Now that we completed the ConcurrentPipeWriter, the GetMemory() and Advance() calls are replayed.
320-
// Make sure that MockPipeWriter.SlabMemoryPoolBlockSize matches SlabMemoryPool._blockSize or else
320+
// Make sure that MockPipeWriter.PinnedBlockMemoryPoolBlockSize matches PinnedBlockMemoryPool._blockSize or else
321321
// it might take more or less calls to the inner PipeWriter's GetMemory method to copy all the data.
322322
Assert.Equal(3, mockPipeWriter.GetMemoryCallCount);
323323
Assert.Equal(3, mockPipeWriter.AdvanceCallCount);
@@ -329,8 +329,8 @@ public async Task CompleteFlushesQueuedBytes()
329329
[Fact]
330330
public async Task CancelPendingFlushInterruptsFlushLoop()
331331
{
332-
using (var slabPool = new SlabMemoryPool())
333-
using (var diagnosticPool = new DiagnosticMemoryPool(slabPool))
332+
using (var memoryPool = new PinnedBlockMemoryPool())
333+
using (var diagnosticPool = new DiagnosticMemoryPool(memoryPool))
334334
{
335335
var pipeWriterFlushTcsArray = new[] {
336336
new TaskCompletionSource<FlushResult>(TaskCreationOptions.RunContinuationsAsynchronously),
@@ -411,8 +411,8 @@ public async Task CancelPendingFlushInterruptsFlushLoop()
411411

412412
private class MockPipeWriter : PipeWriter
413413
{
414-
// It's important that this matches SlabMemoryPool._blockSize for all the tests to pass.
415-
private const int SlabMemoryPoolBlockSize = 4096;
414+
// It's important that this matches PinnedBlockMemoryPool._blockSize for all the tests to pass.
415+
private const int PinnedBlockMemoryPoolBlockSize = 4096;
416416

417417
private readonly TaskCompletionSource<FlushResult>[] _flushResults;
418418

@@ -440,7 +440,7 @@ public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellation
440440
public override Memory<byte> GetMemory(int sizeHint = 0)
441441
{
442442
GetMemoryCallCount++;
443-
return new Memory<byte>(new byte[sizeHint == 0 ? SlabMemoryPoolBlockSize : sizeHint]);
443+
return new Memory<byte>(new byte[sizeHint == 0 ? PinnedBlockMemoryPoolBlockSize : sizeHint]);
444444
}
445445

446446
public override Span<byte> GetSpan(int sizeHint = 0)

src/Servers/Kestrel/Core/test/DiagnosticMemoryPoolTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.Extensions.Internal.Test
1111
{
1212
public class DiagnosticMemoryPoolTests: MemoryPoolTests
1313
{
14-
protected override MemoryPool<byte> CreatePool() => new DiagnosticMemoryPool(new SlabMemoryPool());
14+
protected override MemoryPool<byte> CreatePool() => new DiagnosticMemoryPool(new PinnedBlockMemoryPool());
1515

1616
[Fact]
1717
public void DoubleDisposeThrows()
@@ -176,7 +176,7 @@ public void GetMemoryTryGetArrayOfDisposedThrows()
176176
[Fact]
177177
public async Task DoesNotThrowWithLateReturns()
178178
{
179-
var memoryPool = new DiagnosticMemoryPool(new SlabMemoryPool(), allowLateReturn: true);
179+
var memoryPool = new DiagnosticMemoryPool(new PinnedBlockMemoryPool(), allowLateReturn: true);
180180
var block = memoryPool.Rent();
181181
memoryPool.Dispose();
182182
block.Dispose();
@@ -186,7 +186,7 @@ public async Task DoesNotThrowWithLateReturns()
186186
[Fact]
187187
public async Task ThrowsOnAccessToLateBlocks()
188188
{
189-
var memoryPool = new DiagnosticMemoryPool(new SlabMemoryPool(), allowLateReturn: true);
189+
var memoryPool = new DiagnosticMemoryPool(new PinnedBlockMemoryPool(), allowLateReturn: true);
190190
var block = memoryPool.Rent();
191191
memoryPool.Dispose();
192192

@@ -202,7 +202,7 @@ public async Task ThrowsOnAccessToLateBlocks()
202202
[Fact]
203203
public void ExceptionsContainStackTraceWhenEnabled()
204204
{
205-
var memoryPool = new DiagnosticMemoryPool(new SlabMemoryPool(), rentTracking: true);
205+
var memoryPool = new DiagnosticMemoryPool(new PinnedBlockMemoryPool(), rentTracking: true);
206206
var block = memoryPool.Rent();
207207

208208
ExpectDisposeException(memoryPool);

src/Servers/Kestrel/Core/test/Http1ConnectionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class Http1ConnectionTests : IDisposable
4242

4343
public Http1ConnectionTests()
4444
{
45-
_pipelineFactory = SlabMemoryPoolFactory.Create();
45+
_pipelineFactory = PinnedBlockMemoryPoolFactory.Create();
4646
var options = new PipeOptions(_pipelineFactory, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
4747
var pair = DuplexPipe.CreateConnectionPair(options, options);
4848

src/Servers/Kestrel/Core/test/HttpResponseHeadersTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class HttpResponseHeadersTests
2323
[Fact]
2424
public void InitialDictionaryIsEmpty()
2525
{
26-
using (var memoryPool = SlabMemoryPoolFactory.Create())
26+
using (var memoryPool = PinnedBlockMemoryPoolFactory.Create())
2727
{
2828
var options = new PipeOptions(memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
2929
var pair = DuplexPipe.CreateConnectionPair(options, options);

src/Servers/Kestrel/Core/test/OutputProducerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class OutputProducerTests : IDisposable
2121

2222
public OutputProducerTests()
2323
{
24-
_memoryPool = SlabMemoryPoolFactory.Create();
24+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
2525
}
2626

2727
public void Dispose()

src/Servers/Kestrel/Core/test/SlabMemoryPoolTests.cs renamed to src/Servers/Kestrel/Core/test/PinnedBlockMemoryPoolTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
namespace Microsoft.Extensions.Internal.Test
88
{
9-
public class SlabMemoryPoolTests: MemoryPoolTests
9+
public class PinnedBlockMemoryPoolTests: MemoryPoolTests
1010
{
11-
protected override MemoryPool<byte> CreatePool() => new SlabMemoryPool();
11+
protected override MemoryPool<byte> CreatePool() => new PinnedBlockMemoryPool();
1212

1313
[Fact]
1414
public void DoubleDisposeWorks()

src/Servers/Kestrel/Core/test/PipelineExtensionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class PipelineExtensionTests : IDisposable
1717
private const int _ulongMaxValueLength = 20;
1818

1919
private readonly Pipe _pipe;
20-
private readonly MemoryPool<byte> _memoryPool = SlabMemoryPoolFactory.Create();
20+
private readonly MemoryPool<byte> _memoryPool = PinnedBlockMemoryPoolFactory.Create();
2121

2222
public PipelineExtensionTests()
2323
{

src/Servers/Kestrel/Core/test/StartLineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ public void AuthorityForms(string rawTarget, string path, string query)
518518

519519
public StartLineTests()
520520
{
521-
MemoryPool = SlabMemoryPoolFactory.Create();
521+
MemoryPool = PinnedBlockMemoryPoolFactory.Create();
522522
var options = new PipeOptions(MemoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
523523
var pair = DuplexPipe.CreateConnectionPair(options, options);
524524
Transport = pair.Transport;

src/Servers/Kestrel/Core/test/TestHelpers/TestInput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestInput : IDisposable
2323

2424
public TestInput(IKestrelTrace log = null, ITimeoutControl timeoutControl = null)
2525
{
26-
_memoryPool = SlabMemoryPoolFactory.Create();
26+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
2727
var options = new PipeOptions(pool: _memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
2828
var pair = DuplexPipe.CreateConnectionPair(options, options);
2929
Transport = pair.Transport;

src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
1616
{
1717
internal partial class LibuvConnection : TransportConnection
1818
{
19-
private static readonly int MinAllocBufferSize = SlabMemoryPool.BlockSize / 2;
19+
private static readonly int MinAllocBufferSize = PinnedBlockMemoryPool.BlockSize / 2;
2020

2121
private static readonly Action<UvStreamHandle, int, object> _readCallback =
2222
(handle, status, state) => ReadCallback(handle, status, state);

src/Servers/Kestrel/Transport.Libuv/src/LibuvTransportOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class LibuvTransportOptions
4545
[Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
4646
public long? MaxWriteBufferSize { get; set; } = 64 * 1024;
4747

48-
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.SlabMemoryPoolFactory.Create;
48+
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
4949

5050
private static int ProcessorThreadCount
5151
{

src/Servers/Kestrel/Transport.Libuv/test/LibuvOutputConsumerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class LibuvOutputConsumerTests : IDisposable
4141

4242
public LibuvOutputConsumerTests()
4343
{
44-
_memoryPool = SlabMemoryPoolFactory.Create();
44+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
4545
_mockLibuv = new MockLibuv();
4646

4747
var context = new TestLibuvTransportContext();

src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class QuicTransportOptions
4242
/// </summary>
4343
public long? MaxWriteBufferSize { get; set; } = 64 * 1024;
4444

45-
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.SlabMemoryPoolFactory.Create;
45+
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
4646

4747
}
4848
}

src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
1515
{
1616
internal sealed partial class SocketConnection : TransportConnection
1717
{
18-
private static readonly int MinAllocBufferSize = SlabMemoryPool.BlockSize / 2;
18+
private static readonly int MinAllocBufferSize = PinnedBlockMemoryPool.BlockSize / 2;
1919

2020
private readonly Socket _socket;
2121
private readonly ISocketsTrace _trace;

src/Servers/Kestrel/Transport.Sockets/src/SocketTransportOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ public class SocketTransportOptions
6565
/// </remarks>
6666
public bool UnsafePreferInlineScheduling { get; set; }
6767

68-
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.SlabMemoryPoolFactory.Create;
68+
internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
6969
}
7070
}

src/Servers/Kestrel/perf/Microbenchmarks/ChunkWriterBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class ChunkWriterBenchmark
2020
[GlobalSetup]
2121
public void Setup()
2222
{
23-
_memoryPool = SlabMemoryPoolFactory.Create();
23+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
2424
var pipe = new Pipe(new PipeOptions(_memoryPool));
2525
_reader = pipe.Reader;
2626
_writer = pipe.Writer;

src/Servers/Kestrel/perf/Microbenchmarks/Http1ConnectionBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Http1ConnectionBenchmark
2929
[GlobalSetup]
3030
public void Setup()
3131
{
32-
var memoryPool = SlabMemoryPoolFactory.Create();
32+
var memoryPool = PinnedBlockMemoryPoolFactory.Create();
3333
var options = new PipeOptions(memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
3434
var pair = DuplexPipe.CreateConnectionPair(options, options);
3535

src/Servers/Kestrel/perf/Microbenchmarks/Http1ConnectionParsingOverheadBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Http1ConnectionParsingOverheadBenchmark
2323
[IterationSetup]
2424
public void Setup()
2525
{
26-
var memoryPool = SlabMemoryPoolFactory.Create();
26+
var memoryPool = PinnedBlockMemoryPoolFactory.Create();
2727
var options = new PipeOptions(memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
2828
var pair = DuplexPipe.CreateConnectionPair(options, options);
2929

src/Servers/Kestrel/perf/Microbenchmarks/Http1LargeWritingBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Http1LargeWritingBenchmark
2828
[GlobalSetup]
2929
public void GlobalSetup()
3030
{
31-
_memoryPool = SlabMemoryPoolFactory.Create();
31+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
3232
_http1Connection = MakeHttp1Connection();
3333
_consumeResponseBodyTask = ConsumeResponseBody();
3434
}

src/Servers/Kestrel/perf/Microbenchmarks/Http1ReadingBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Http1ReadingBenchmark
3535
[GlobalSetup]
3636
public void GlobalSetup()
3737
{
38-
_memoryPool = SlabMemoryPoolFactory.Create();
38+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
3939
_http1Connection = MakeHttp1Connection();
4040
}
4141

src/Servers/Kestrel/perf/Microbenchmarks/Http1WritingBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Http1WritingBenchmark
3535
[GlobalSetup]
3636
public void GlobalSetup()
3737
{
38-
_memoryPool = SlabMemoryPoolFactory.Create();
38+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
3939
_http1Connection = MakeHttp1Connection();
4040
_consumeResponseBodyTask = ConsumeResponseBody();
4141
}

src/Servers/Kestrel/perf/Microbenchmarks/Http2ConnectionBenchmarkBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class Http2ConnectionBenchmarkBase
4242

4343
public virtual void GlobalSetup()
4444
{
45-
_memoryPool = SlabMemoryPoolFactory.Create();
45+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
4646
_httpFrame = new Http2Frame();
4747

4848
var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);

src/Servers/Kestrel/perf/Microbenchmarks/Http2FrameWriterBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class Http2FrameWriterBenchmark
2424
[GlobalSetup]
2525
public void GlobalSetup()
2626
{
27-
_memoryPool = SlabMemoryPoolFactory.Create();
27+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
2828

2929
var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
3030
_pipe = new Pipe(options);

src/Servers/Kestrel/perf/Microbenchmarks/HttpProtocolFeatureCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public IHttpNotFoundFeature Get_IHttpNotFoundFeature()
226226

227227
public HttpProtocolFeatureCollection()
228228
{
229-
var memoryPool = SlabMemoryPoolFactory.Create();
229+
var memoryPool = PinnedBlockMemoryPoolFactory.Create();
230230
var options = new PipeOptions(memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
231231
var pair = DuplexPipe.CreateConnectionPair(options, options);
232232

src/Servers/Kestrel/perf/Microbenchmarks/PipeThroughputBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class PipeThroughputBenchmark
1919
[IterationSetup]
2020
public void Setup()
2121
{
22-
_memoryPool = SlabMemoryPoolFactory.Create();
22+
_memoryPool = PinnedBlockMemoryPoolFactory.Create();
2323
_pipe = new Pipe(new PipeOptions(_memoryPool));
2424
}
2525

0 commit comments

Comments
 (0)