Method CopyStringToPayloadBuffer__Unmanaged
CopyStringToPayloadBuffer__Unmanaged(byte*, int, ref LogMemoryManager, bool, bool, bool)
Allocates memory in the LogMemoryManager and copies data into it with headers.
Declaration
[RequiredMember]
public static PayloadHandle CopyStringToPayloadBuffer__Unmanaged(byte* sourcePtr, int sourceLength, ref LogMemoryManager memAllocator, bool prependTypeId = false, bool prependLength = false, bool deferredRelease = false)
Parameters
| Type | Name | Description |
|---|---|---|
| byte* | sourcePtr | Pointer to data |
| int | sourceLength | Length of data in bytes |
| LogMemoryManager | memAllocator | MemoryManager where to allocate the PayloadHandle |
| bool | prependTypeId | If true - typeId will be added to payload |
| bool | prependLength | If true - length in bytes will be added to payload |
| bool | deferredRelease | If true - PayloadHandle will be registered for deferred release (after 2 updates) |
Returns
| Type | Description |
|---|---|
| PayloadHandle | PayloadHandle that holds the data |
Remarks
Create a copy of the string message in PayloadBuffer, prepended with optional typeId and length. When CopyStringToPayloadBuffer is called in Burst code, CopyStringToPayloadBuffer__Unmanaged is called instead.