docs.unity3d.com
    Show / Hide Table of Contents

    Struct PayloadHandle

    Holds a 64-bit value that uniquely references an allocated memory block within LogMemoryManager.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Logging
    Syntax
    [BurstCompile]
    public readonly struct PayloadHandle : IEquatable<PayloadHandle>
    Remarks

    This is the primary field in LogMessage. The value is opaque and shouldn't be accessed externally. It encodes the following data/fields: [Offset - 32bits][Version - 16bits][BufferID - 8bits][BitFlags - 8 bits]

    Offset - Byte offset (index) within the RingBuffer of the allocated Payload chunk (includes header) Version - Handle validation value; must match Version within chunk header or handle is rejected BufferID - Identifies specific RingBuffer by an ID value (MemoryManager can maintain multiple RingBuffers) BitFields - Other flags an/or misc. data

    The handle holds a unique, single-use value that references a specific memory buffer under the control of LogMemoryManager. Once the referenced memory buffer is released, the handle becomes invalid and any attempt to retrieve the buffer will fail.

    Properties

    IsDisjointedBuffer

    Checks if the PayloadHandle references a Disjointed Buffer.

    Declaration
    public readonly bool IsDisjointedBuffer { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    A Disjointed Buffer is an allocation that contains PayloadHandle values to other allocations. This allows multiple allocated buffers to be combined into a single reference, but as a consequence the memory isn't contiguous and requires multiple handle look-ups to retrieve the entirety of the data.

    IsValid

    Checks if the PayloadHandle value is valid.

    Declaration
    public readonly bool IsValid { get; }
    Property Value
    Type Description
    Boolean

    True if valid and false if not

    Remarks

    Note this doesn't check if the PayloadHandle actually references a valid Payload buffer or not. An invalid handle typically indicates a Payload allocation failed.

    To check if the handle references a valid Payload buffer, call IsPayloadHandleValid(PayloadHandle)

    Methods

    Equals(PayloadHandle)

    Equals method that compares this PayloadHandle with another one

    Declaration
    public readonly bool Equals(PayloadHandle other)
    Parameters
    Type Name Description
    PayloadHandle other

    PayloadHandle

    Returns
    Type Description
    Boolean

    true if they're equal

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Hash function

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    Int32

    Hash value of this PayloadHandle

    Overrides
    ValueType.GetHashCode()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023