public void Free(T[][] data) { lock (_bufferManager) { _bufferManager.Free(data); } }
private void AllocAndFree(IBufferManager <byte> manager) { var alloc = Enumerable.Range(1, Allocations); Parallel.ForEach(alloc, (i) => { var buffer = manager.Allocate(BufferSize); manager.Free(buffer); }); }
private void AllocAndFree(IBufferManager <byte> manager) { var alloc = Enumerable.Range(1, Allocations).Select(i => manager.Allocate(BufferSize)).ToArray(); foreach (var a in alloc) { manager.Free(a); } }
private int DecreaseReferenceInternal() { var ret = Interlocked.Decrement(ref _references); if (ret == 0 && !object.ReferenceEquals(_data, EmptyArray)) { _bufferManager.Free(_data); _data = null; } return(ret); }