Documentation

Unity Engine


Unity Engine


Allocate

Allocates enough memory to store length elements of struct T.
Read time 1 minuteLast updated 3 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

Allocate<T>(BlobArray<T>, int)

Allocates enough memory to store
length
elements of struct
T
.
public BlobBuilderArray<T> Allocate<T>(ref BlobArray<T> ptr, int length) where T : struct

Parameters

A reference to a BlobArray field in a blob asset.

length

The number of elements to allocate.

Returns

Type

Description

BlobBuilderArray<T>A reference to the newly allocated array as a mutable BlobBuilderArray instance.

Allocate<T>(BlobArray<T>, int, int)

Allocates enough memory to store
length
elements of struct
T
.
public BlobBuilderArray<T> Allocate<T>(ref BlobArray<T> ptr, int length, int alignment) where T : struct

Parameters

A reference to a BlobArray field in a blob asset.

length

The number of elements to allocate.

alignment

The alignment of the allocated memory.

Returns

Type

Description

BlobBuilderArray<T>A reference to the newly allocated array as a mutable BlobBuilderArray instance.

Allocate<T>(BlobPtr<T>)

Allocates enough memory to store a struct of type
T
.
public ref T Allocate<T>(ref BlobPtr<T> ptr) where T : struct

Parameters

A reference to a blob pointer field in a blob asset.

Returns

Type

Description

TA reference to the newly allocated struct.