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 elements of struct .
lengthTpublic BlobBuilderArray<T> Allocate<T>(ref BlobArray<T> ptr, int length) where T : struct
Parameters
A reference to a BlobArray field in a blob asset.
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 elements of struct .
lengthTpublic 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.
The number of elements to allocate.
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 .
Tpublic 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 |
|---|---|
| T | A reference to the newly allocated struct. |