Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 25f7b7b

Browse files
committed
Pre-allocate memory pool
1 parent 55f6f21 commit 25f7b7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Microsoft.AspNet.Server.Kestrel/Infrastructure/MemoryPool2.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ public class MemoryPool2 : IDisposable
5353
/// </summary>
5454
private bool _disposedValue = false; // To detect redundant calls
5555

56+
public MemoryPool2()
57+
{
58+
// Allocate on creation or multiple simultaneous connections
59+
// will all allocate rather than reuse the pooled buffers
60+
Return(AllocateSlab());
61+
}
62+
5663
/// <summary>
5764
/// Called to take a block from the pool.
5865
/// </summary>

0 commit comments

Comments
 (0)