Method CopyStringToPayloadBuffer
CopyStringToPayloadBuffer(string, ref LogMemoryManager, bool, bool, bool)
Allocates memory in the LogMemoryManager and copies data into it with headers.
Declaration
public static PayloadHandle CopyStringToPayloadBuffer(string source, ref LogMemoryManager memAllocator, bool prependTypeId = false, bool prependLength = false, bool deferredRelease = false)
Parameters
Type | Name | Description |
---|---|---|
string | source | String that stores the data in UTF16 |
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 string message in UTF8 in PayloadBuffer, prepended with optional typeId and length. When CopyStringToPayloadBuffer is called in the Burst code, CopyStringToPayloadBuffer__Unmanaged is called instead