Allocate
Returns an allocation from the allocator's internal buffer.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.ManagedKernelModule
Allocate(int, int)
Returns an allocation from the allocator's internal buffer.
public void* Allocate(int sizeInBytes, int alignmentInBytes)
Parameters
Returns
Type | Description |
|---|---|
| void* | A pointer to the new allocation. |
Allocate<T>(int)
Returns an allocation from the allocator's internal buffer.
public void* Allocate<T>(int count = 1) where T : unmanaged
Parameters
The number of elements to allocate space for. Defaults to 1.
Returns
Type | Description |
|---|---|
| void* | A pointer to the new allocation. |
Remarks
The allocation size in bytes is at least . The space consumed by the allocation may be a little larger than this size due to alignment.
count * sizeof(T)