Example #1
0
 void EnsureCapacityTest(int size, int expect)
 {
     BufferPoolEx.EnsureCapacity(size);
     for (int i = 0; i < BufferPoolEx.pool.Length; ++i)
     {
         var pool = BufferPoolEx.pool[i];
         Debug.Assert(pool.Count == expect);
         for (int j = 0; j < pool.Count; ++j)
         {
             byte[] bytes = pool[j];
             Debug.Assert(bytes != null);
             Debug.Assert(bytes.Length == ((i + 1) << BufferPoolEx.shift));
         }
     }
 }
Example #2
0
 void Awake()
 {
     instance = this;
     BufferPoolEx.EnsureCapacity(16);
 }