Method AllocatePayload
AllocatePayload(uint, out PayloadHandle, out NativeArray<byte>, bool)
Allocate a block of memory from the container.
Declaration
public bool AllocatePayload(uint requestedSize, out PayloadHandle payloadHandle, out NativeArray<byte> payloadArray, bool disjointedBuffer = false)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | requestedSize | Size of memory block in bytes to allocate. |
| PayloadHandle | payloadHandle | Handle to the memory block, if allocation was successful. |
| NativeArray<byte> | payloadArray | NativeArray allowing read/write access into the memory block. |
| bool | disjointedBuffer | True to specify allocation is the "head" of a Disjointed Payload. |
Returns
| Type | Description |
|---|---|
| bool | True if allocation was successful and false if not |
Remarks
Actual size of the allocation is slightly larger than requestedSize, as additional bytes are needed for the memory block's header.