public GetFixedDataContainer ( int size, string description ) : |
||
size | int | |
description | string | |
return |
public GATData GetFixedDataContainer( int size, string description )
{
if( _unallocatedCursor.MaxSize < size )
{
throw new GATException( "Out of fixed memory!" );
}
int offset;
GATFixedData ret;
offset = _endCursor.MemOffset - size;
ret = new GATFixedData( this, description );
ret.AllocateFree( offset, _endCursor.next );
ret.allocatedSize = size;
_endCursor.AllocateFree( offset, ret );
_fixedAllocationsSize += size;
return ret;
}
/// <summary> /// Convenience method to request a chunk of fixed virtual memory from the default /// GATDataAllocator instance. /// </summary> public static GATData GetFixedDataContainer(int length, string description) { #if UNITY_EDITOR if (Application.isPlaying == false) { return(new GATData(new float[length])); } #endif return(__allocator.GetFixedDataContainer(length, description)); }