Imports/Trinet.Core.IO.Ntfs/Source/StreamName.cs
/// <summary>
/// Ensures that there is sufficient memory allocated.
/// </summary>
/// <param name="capacity">
/// The required capacity of the block, in bytes.
/// </param>
/// <exception cref="OutOfMemoryException">
/// There is insufficient memory to satisfy the request.
/// </exception>
Ensures that there is sufficient memory allocated.
Ensures that there is sufficient memory allocated .
public void EnsureCapacity(int capacity)
		{
			int currentSize = _memoryBlock.IsInvalid ? 0 : _memoryBlock.Size;
			if (capacity > currentSize)
			{
				if (0 != currentSize) currentSize <<= 1;
				if (capacity > currentSize) currentSize = capacity;
				if (!_memoryBlock.IsInvalid) _memoryBlock.Dispose();
				_memoryBlock = SafeHGlobalHandle.Allocate(currentSize);
			}
		}
public void EnsureCapacity ( int capacity ) { int currentSize = _memoryBlock . IsInvalid ? 0 : _memoryBlock . Size ; if ( capacity > currentSize ) { if ( 0 != currentSize ) currentSize <<= 1 ; if ( capacity > currentSize ) currentSize = capacity ; if ( ! _memoryBlock . IsInvalid ) _memoryBlock . Dispose ( ) ; _memoryBlock = SafeHGlobalHandle . Allocate ( currentSize ) ; } }
Ensures that there is sufficient memory allocated.
Ensures that there is sufficient memory allocated .
There is insufficient memory to satisfy the request.
There is insufficient memory to satisfy the request .
capacity
int
The required capacity of the block, in bytes.
The required capacity of the block in bytes .