public void CopyFrom(ObiNativeList <T> source) { if (source == null || !isCreated || !source.isCreated) { throw new ArgumentNullException(); } if (m_Count < source.m_Count) { throw new ArgumentOutOfRangeException(); } UnsafeUtility.MemCpy(m_AlignedPtr, source.m_AlignedPtr, source.count * m_Stride); }
public bool Compare(ObiNativeList <T> other) { if (other == null || !isCreated || !other.isCreated) { throw new ArgumentNullException(); } if (m_Count != other.m_Count) { return(false); } return(UnsafeUtility.MemCmp(m_AlignedPtr, other.m_AlignedPtr, m_Count * m_Stride) == 0); }
public void CopyFrom(ObiNativeList <T> other) { if (other == null) { throw new ArgumentNullException(); } if (m_Count < other.m_Count) { throw new ArgumentException(); } unsafe { UnsafeUtility.MemCpy(m_AlignedPtr, other.m_AlignedPtr, other.count * m_Stride); } }
public void CopyFrom(ObiNativeList <T> source, int sourceIndex, int destIndex, int length) { if (source == null || !isCreated || !source.isCreated) { throw new ArgumentNullException(); } if (length <= 0 || source.m_Count == 0) { return; } if (sourceIndex >= source.m_Count || sourceIndex < 0 || destIndex >= m_Count || destIndex < 0 || sourceIndex + length > source.m_Count || destIndex + length > m_Count) { throw new ArgumentOutOfRangeException(); } void *sourceAddress = source.AddressOfElement(sourceIndex); void *destAddress = AddressOfElement(destIndex); UnsafeUtility.MemCpy(destAddress, sourceAddress, length * m_Stride); }