GAudio.GATDataAllocator.NbOfAvailableChunksForSize C# (CSharp) Method

NbOfAvailableChunksForSize() public method

A conservative estimate of the available number of chunks. Takes into account both unfragmented memory and recyclable previously allocated chunks.
public NbOfAvailableChunksForSize ( int size ) : int
size int
return int
        public int NbOfAvailableChunksForSize( int size )
        {
            int binIndex = GetBinIndexForSize( size );
            int total = 0;
            while( binIndex < _nbOfBins )
            {
                total += _freeChunksBins[ binIndex ].Count;
                binIndex++;
            }

            total += ( _unallocatedCursor.MaxSize / size );

            return total;
        }