Method Allocate
Allocate(int, int)
Returns an allocation from the allocator's internal buffer.
Declaration
public void* Allocate(int sizeInBytes, int alignmentInBytes)
Parameters
Type | Name | Description |
---|---|---|
int | sizeInBytes | The size of the new allocation. |
int | alignmentInBytes | The alignment of the new allocation. |
Returns
Type | Description |
---|---|
void* | A pointer to the new allocation. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the new allocation would exceed the capacity of the allocator. |
Allocate<T>(int)
Returns an allocation from the allocator's internal buffer.
Declaration
public void* Allocate<T>(int count = 1) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | count | The number of elements to allocate space for. Defaults to 1. |
Returns
Type | Description |
---|---|
void* | A pointer to the new allocation. |
Type Parameters
Name | Description |
---|---|
T | The type of element to allocate space for. |
Remarks
The allocation size in bytes is at least count * sizeof(T)
. The space consumed by the allocation may be a little larger than this size due to alignment.
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the new allocation would exceed the capacity of the allocator. |