Skip to content

Commit

Permalink
Revert "Revert "Explain why 10""
Browse files Browse the repository at this point in the history
This reverts commit 96e690e.
  • Loading branch information
paulpach committed Mar 29, 2020
1 parent 20e9e5d commit d727e4f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Assets/Mirror/Runtime/NetworkWriterPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public void Dispose()
}
public static class NetworkWriterPool
{
// Mirror only uses 4 writers at a time.
// if the user requests for 100 writers, we just cache 10
// and let the GC collect the other ones.
// that way we are protected from memory leaks
// while maintaining good performance.
public const int MaxPoolSize = 10;

static readonly PooledNetworkWriter[] pool = new PooledNetworkWriter[MaxPoolSize];
Expand Down

0 comments on commit d727e4f

Please sign in to comment.