/// <summary>
 /// Default constructor.
 /// </summary>
 public SampleBuffer(int initialSize)
 {
     //
     // Init mamnaged fifo memory pool. Set shrinkThresholdPercentage to 0.3 so that when free size is bigger than
     // 30% of total size, pool can shrink to reduce memory consumption
     //
     _pool = new FIFOMemoryPool(initialSize, _shrinkThresholdPercentage);
     _samples = new Queue<Sample>();
     _sampleWrapperPool = new Queue<Sample>();
 }
 public PoolAllocItem(PoolBlockIndex startIndex, PoolBlockIndex endIndex, FIFOMemoryPool pool)
 {
     _startIndex = startIndex;
     _endIndex = endIndex;
     _writeOffset = 0;
     _readOffset = 0;
     _pool = pool;
 }
 public void Reset(FIFOMemoryPool pool)
 {
     lock (this)
     {
         _writeOffset = 0;
         _readOffset = 0;
         _pool = pool;
     }
 }