コード例 #1
0
 /// <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>();
 }
コード例 #2
0
 public PoolAllocItem(PoolBlockIndex startIndex, PoolBlockIndex endIndex, FIFOMemoryPool pool)
 {
     _startIndex = startIndex;
     _endIndex = endIndex;
     _writeOffset = 0;
     _readOffset = 0;
     _pool = pool;
 }
コード例 #3
0
 public void Reset(FIFOMemoryPool pool)
 {
     lock (this)
     {
         _writeOffset = 0;
         _readOffset = 0;
         _pool = pool;
     }
 }