Struct LogMemoryManager
Interface for allocating and managing Payload buffers for LogMessage.
Inherited Members
Namespace: Unity.Logging
Assembly: solution.dll
Syntax
[BurstCompile]
[GenerateTestsForBurstCompatibility]
public struct LogMemoryManager
Remarks
A Payload buffer is allocated when creating a new log message, the actual message data, i.e. the "Payload", is serialized into this buffer by the log producer. A PayloadHandle references the allocated memory and is later used by a Listener to access the buffer and de-serialize the message data. After the message has been processed by a Listener, the Payload buffer must be released, typically performed automatically by LogController.
Fields
Name | Description |
---|---|
MaximumRingBufferGrowFactor | Maximum value for BufferGrowFactor |
MaximumRingBufferGrowThreshold | Maximum value for BufferGrowThreshold |
MaximumRingBufferSampleCount | Maximum value for BufferSampleCount |
MaximumRingBufferShrinkFactor | Maximum value for BufferShrinkFactor |
MaximumRingBufferShrinkThreshold | Maximum value for BufferShrinkThreshold |
MinimumRingBufferGrowFactor | Minimum value for BufferGrowFactor |
MinimumRingBufferGrowThreshold | Minimum value for BufferGrowThreshold |
MinimumRingBufferShrinkFactor | Minimum value for BufferShrinkFactor |
MinimumRingBufferShrinkThreshold | Minimum value for BufferShrinkThreshold |
Properties
Name | Description |
---|---|
IsInitialized | Returns if this LogMemoryManager instance is currently initialized. |
Parameters | Parameter values provided to Initialize(LogMemoryManagerParameters). |
Methods
Name | Description |
---|---|
AllocateDisjointedBuffer(ref FixedList512Bytes<ushort>, NativeList<PayloadHandle>) | Allocates a new Disjointed buffer, which includes allocating the individual Payloads that make up the entire buffer. |
AllocateDisjointedBuffer(ref FixedList64Bytes<ushort>, NativeList<PayloadHandle>) | Allocates a new Disjointed buffer, which includes allocating the individual Payloads that make up the entire buffer. |
AllocateDisjointedBuffer(ref NativeList<ushort>, NativeList<PayloadHandle>) | Allocates a new Disjointed buffer, which includes allocating the individual Payloads that make up the entire buffer. |
AllocatePayloadBuffer(uint) | Allocates a new Payload buffer from the default Payload container. |
AllocatePayloadBuffer(uint, out NativeArray<byte>) | Allocates a new Payload buffer from the default Payload container. |
CreateDisjointedPayloadBufferFromExistingPayloads(ref FixedList4096Bytes<PayloadHandle>) | Creates a new Disjointed buffer that's composed of preallocated Payloads, instead of allocating new ones. |
CreateDisjointedPayloadBufferFromExistingPayloads(ref FixedList512Bytes<PayloadHandle>) | Creates a new Disjointed buffer that's composed of preallocated Payloads, instead of allocating new ones. |
CreateDisjointedPayloadBufferFromExistingPayloads(ref NativeList<PayloadHandle>) | Creates a new Disjointed buffer that's composed of preallocated Payloads, instead of allocating new ones. |
DebugDetailsOfPayloadHandle(ref PayloadHandle) | Debug function that returns information about PayloadHandle |
DebugStateString(FixedString128Bytes) | Gathers the internal statistics of this LogMemoryManager |
FromPointer(IntPtr) | Converts pointer into ref LogMemoryManager |
GetCurrentDefaultBufferCapacity() | Returns the Capacity of the current Payload container from which Payloads are allocated from. |
GetCurrentDefaultBufferUsage() | Returns the Usage of the current Payload container from which Payloads are allocated from. |
Initialize() | Initializes MemoryManager using default parameters. |
Initialize(LogMemoryManagerParameters) | Initializes MemoryManager with the specified set of parameters. |
IsPayloadBufferLocked(PayloadHandle) | Tests if the specified Payload buffer is locked and returns the number of individual locks. |
IsPayloadBufferLocked(PayloadHandle, out int) | Tests if the specified Payload buffer is locked and returns the number of individual locks. |
IsPayloadHandleValid(PayloadHandle) | Tests if PayloadHandle references a valid Payload buffer or not. |
LockPayloadBuffer(PayloadHandle) | Adds a "Lock" on the specified Payload buffer, preventing it from being released while the lock is active. |
ReleasePayloadBuffer(PayloadHandle, out PayloadReleaseResult, bool) | Releases the Payload memory allocated within the default Payload container. |
ReleasePayloadBufferDeferred(PayloadHandle) | Releases the Payload memory allocated within the default Payload container after two (system is double buffered) Update()> calls |
RetrieveDisjointedPayloadBuffer(PayloadHandle, int, bool, out NativeArray<byte>) | Retrieves a NativeArray to safely access an individual Payload that's part of a Disjointed buffer. |
RetrieveDisjointedPayloadBuffer(PayloadHandle, int, out NativeArray<byte>) | Retrieves a NativeArray to safely access an individual Payload that's part of a Disjointed buffer. |
RetrievePayloadBuffer(PayloadHandle, bool, out NativeArray<byte>) | Retrieves a NativeArray to safely access Payload memory. |
RetrievePayloadBuffer(PayloadHandle, out NativeArray<byte>) | Retrieves a NativeArray to safely access Payload memory. |
Shutdown() | Releases all allocated memory and returns MemoryManager to an uninitialized state. |
UnlockPayloadBuffer(PayloadHandle, PayloadLockContext) | Releases an existing Payload Lock on the specified buffer for a given context. |
Update() | Performs maintenance work on the allocated RingBuffers and should be called once per frame. Enters exclusive lock, so make sure it is not called during LockRead() on the same thread. LockRead() UnlockRead() |