ドキュメント

Unity Engine

Download Unity

Unity Engine

AllocateNativeArray<T>(int)

Allocate a NativeArray of type T from memory that's guaranteed to remain valid until ScratchpadAllocator.Rewind is called on the Scratchpad.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public NativeArray<T> AllocateNativeArray<T>(int length) where T : unmanaged

Parameters

length

The number of items in the NativeArray.

Returns

Type

Description

NativeArray<T>Returns the NativeArray.

Remarks

This memory isn't shared between threads and you don't need to Dispose the NativeArray so it's allocated. You can't Dispose the memory to free it: it's automatically freed when ScratchpadAllocator.Rewind is called.