Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

CollectionHelper

class in Unity.Collections

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Provides helper methods for collections.

Static Properties

Property Description
CacheLineSize The size in bytes of the current platform's L1 cache lines.

Static Methods

Method Description
Align Returns an allocation size in bytes that factors in alignment.
CheckReflectionDataCorrect Checks that reflection data was properly registered for a job.
ConvertExistingDataToNativeArray Convert existing data into a NativeArray.
ConvertExistingNativeListToNativeArray Convert NativeList into a NativeArray.
CreateNativeArray Create a NativeArray, using a provided allocator that implements IAllocator.
CreateNativeParallelMultiHashMap Create a NativeParallelMultiHashMap from a managed array, using a provided Allocator.
CreateSafetyHandle Creates a new AtomicSafetyHandle that is valid until CollectionHelper.DisposeSafetyHandle is called.
Dispose Dispose a NativeArray from an AllocatorHandle where it is allocated.
DisposeNativeArray Dispose a NativeArray from an AllocatorHandle where it is allocated.
DisposeSafetyHandle Disposes a previously created AtomicSafetyHandle.
Hash Returns a (non-cryptographic) hash of a memory block.
IsAligned Returns true if the address represented by the pointer has a given alignment.
IsPowerOfTwo Returns true if a positive value is a non-zero power of two.
Log2Ceil Returns the binary logarithm of the value, but the result is rounded up to the nearest integer.
Log2Floor Returns the binary logarithm of the value, but the result is rounded down to the nearest integer.
SetStaticSafetyId Assigns the provided static safety ID to an AtomicSafetyHandle. The ID's owner type name and any custom error messages are used by the job debugger when reporting errors involving the target handle.