26 instantiations of PinnedBlockMemoryPool
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\PinnedBlockMemoryPoolFactory.cs (1)
30
var pool = new
PinnedBlockMemoryPool
(_meterFactory, _logger);
src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (1)
49
var pool = new
PinnedBlockMemoryPool
(_meterFactory, _logger);
src\Shared\Buffers.MemoryPool\MemoryPoolFactory.cs (1)
24
return new
PinnedBlockMemoryPool
(meterFactory);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (21)
ConcurrentPipeWriterTests.cs (5)
20
using (var memoryPool = new
PinnedBlockMemoryPool
())
83
using (var memoryPool = new
PinnedBlockMemoryPool
())
181
using (var memoryPool = new
PinnedBlockMemoryPool
())
265
using (var memoryPool = new
PinnedBlockMemoryPool
())
333
using (var memoryPool = new
PinnedBlockMemoryPool
())
DiagnosticMemoryPoolTests.cs (4)
15
protected override MemoryPool<byte> CreatePool() => new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
());
180
var memoryPool = new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
(), allowLateReturn: true);
190
var memoryPool = new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
(), allowLateReturn: true);
206
var memoryPool = new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
(), rentTracking: true);
PinnedBlockMemoryPoolTests.cs (12)
15
protected override MemoryPool<byte> CreatePool() => new
PinnedBlockMemoryPool
();
36
using var memoryPool = new
PinnedBlockMemoryPool
();
53
using var memoryPool = new
PinnedBlockMemoryPool
();
99
using var memoryPool = new
PinnedBlockMemoryPool
();
133
using var memoryPool = new
PinnedBlockMemoryPool
();
177
using var memoryPool = new
PinnedBlockMemoryPool
();
236
var pool = new
PinnedBlockMemoryPool
(testMeterFactory);
272
var pool = new
PinnedBlockMemoryPool
(testMeterFactory);
295
var pool = new
PinnedBlockMemoryPool
(testMeterFactory);
320
var pool = new
PinnedBlockMemoryPool
(testMeterFactory);
357
var pool1 = new
PinnedBlockMemoryPool
(testMeterFactory);
358
var pool2 = new
PinnedBlockMemoryPool
(testMeterFactory);
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
32
var pool = new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
(), _allowLateReturn, _rentTracking);
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
32
var pool = new DiagnosticMemoryPool(new
PinnedBlockMemoryPool
(), _allowLateReturn, _rentTracking);
46 references to PinnedBlockMemoryPool
Microsoft.AspNetCore.Server.Kestrel.Core (12)
Internal\PinnedBlockMemoryPoolFactory.cs (3)
19
private readonly ConcurrentDictionary<
PinnedBlockMemoryPool
, nuint> _pools = new();
30
var
pool = new PinnedBlockMemoryPool(_meterFactory, _logger);
36
((ConcurrentDictionary<
PinnedBlockMemoryPool
, nuint>)state!).TryRemove(self, out _);
src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (5)
18
private readonly ConcurrentDictionary<
PinnedBlockMemoryPool
, bool> _pools = new();
27
_timer = new PeriodicTimer(
PinnedBlockMemoryPool
.DefaultEvictionDelay);
34
foreach (
var
pool in _pools.Keys)
49
var
pool = new PinnedBlockMemoryPool(_meterFactory, _logger);
55
((ConcurrentDictionary<
PinnedBlockMemoryPool
, bool>)state!).TryRemove(self, out _);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (2)
14
internal MemoryPoolBlock(
PinnedBlockMemoryPool
pool, int length)
26
public
PinnedBlockMemoryPool
Pool { get; }
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
63
private Action<object?,
PinnedBlockMemoryPool
>? _onPoolDisposed;
80
public void OnPoolDisposed(Action<object?,
PinnedBlockMemoryPool
> onPoolDisposed, object? state = null)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (34)
ConcurrentPipeWriterTests.cs (5)
20
using (
var
memoryPool = new PinnedBlockMemoryPool())
83
using (
var
memoryPool = new PinnedBlockMemoryPool())
181
using (
var
memoryPool = new PinnedBlockMemoryPool())
265
using (
var
memoryPool = new PinnedBlockMemoryPool())
333
using (
var
memoryPool = new PinnedBlockMemoryPool())
PinnedBlockMemoryPoolFactoryTests.cs (7)
21
Assert.IsType<
PinnedBlockMemoryPool
>(pool);
43
var dict = (ConcurrentDictionary<
PinnedBlockMemoryPool
, nuint>)(typeof(PinnedBlockMemoryPoolFactory)
59
var
pool = Assert.IsType<
PinnedBlockMemoryPool
>(factory.Create());
60
var
pool2 = Assert.IsType<
PinnedBlockMemoryPool
>(factory.Create());
95
static async Task VerifyPoolEviction(
PinnedBlockMemoryPool
pool, int previousCount)
PinnedBlockMemoryPoolTests.cs (22)
36
using
var
memoryPool = new PinnedBlockMemoryPool();
53
using
var
memoryPool = new PinnedBlockMemoryPool();
99
using
var
memoryPool = new PinnedBlockMemoryPool();
133
using
var
memoryPool = new PinnedBlockMemoryPool();
177
using
var
memoryPool = new PinnedBlockMemoryPool();
236
var
pool = new PinnedBlockMemoryPool(testMeterFactory);
243
Assert.Collection(currentMemoryMetric.GetMeasurementSnapshot(), m => Assert.Equal(
PinnedBlockMemoryPool
.BlockSize, m.Value));
247
Assert.Equal(-1 *
PinnedBlockMemoryPool
.BlockSize, currentMemoryMetric.LastMeasurement.Value);
254
Assert.Equal(2 *
PinnedBlockMemoryPool
.BlockSize, currentMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
272
var
pool = new PinnedBlockMemoryPool(testMeterFactory);
280
Assert.Equal(2 *
PinnedBlockMemoryPool
.BlockSize, totalMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
286
Assert.Equal(2 *
PinnedBlockMemoryPool
.BlockSize, totalMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
295
var
pool = new PinnedBlockMemoryPool(testMeterFactory);
304
m => Assert.Equal(
PinnedBlockMemoryPool
.BlockSize, m.Value),
305
m => Assert.Equal(
PinnedBlockMemoryPool
.BlockSize, m.Value));
311
Assert.Equal(2 *
PinnedBlockMemoryPool
.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());
320
var
pool = new PinnedBlockMemoryPool(testMeterFactory);
346
Assert.Equal(
PinnedBlockMemoryPool
.BlockSize, measurement.Value);
357
var
pool1 = new PinnedBlockMemoryPool(testMeterFactory);
358
var
pool2 = new PinnedBlockMemoryPool(testMeterFactory);
364
Assert.Equal(2 *
PinnedBlockMemoryPool
.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());
373
Assert.Equal(4 *
PinnedBlockMemoryPool
.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());