{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct UnsafePayloadRingBuffer | Unity Logging | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnsafePayloadRingBuffer

    Logging system's primary container for allocating Payload buffers.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Logging
    Assembly: solution.dll
    Syntax
    [BurstCompile]
    public struct UnsafePayloadRingBuffer : IDisposable
    Remarks

    This container provides the backing memory for message buffers referenced by LogMessage. It allows fast, thread-safe allocations from a pre-allocated array of native memory, which can be safely accessed by a PayloadHandle value.

    This container is utilized internally by LogMemoryManager, and in general it's unnecessary to directly call into it. However, it may be used directly in advanced memory scenarios.

    Constructors

    Name Description
    UnsafePayloadRingBuffer(uint, byte, Allocator)

    Initializes a new instance of the container.

    Fields

    Name Description
    AlignTo

    Power of 2 align value used in RoundToNextAlign(uint)

    BufferId

    Unique ID value assigned by the user which identifies PayloadHandle as referencing allocations from this instance.

    MaximumCapacity

    Maximum capacity of the container.

    MaximumPayloadSize

    Maximum size for a single Payload block (excludes header) that can be allocated.

    MinimumCapacity

    Minimum capacity of the container.

    MinimumPayloadSize

    Minimum size for a single Payload block (excludes header) that can be allocated.

    Properties

    Name Description
    BytesAllocated

    Total number of bytes currently allocated from the RingBuffer, including payload headers.

    BytesAllocatedMax

    Max value of BytesAllocated that was registered.

    Capacity

    Capacity of the RingBuffer, which cannot change after RingBuffer has been initialized

    IsCreated

    Returns true if RingBuffer is initialized and not Disposed.

    MaximumDisjointedPayloadCount

    Returns the maximum number of Payloads that can be referenced within a single DisjointedBuffer.

    Methods

    Name Description
    AllocatePayload(uint, out PayloadHandle, out NativeArray<byte>, bool)

    Allocate a block of memory from the container.

    DebugDetailsOfPayloadHandle(PayloadHandle)

    Debug function that returns details about a particular PayloadHandle.

    Dispose()

    Frees the container's memory and returns this instance to an uninitialized state.

    IsPayloadHandleValid(PayloadHandle)

    Checks if the specified handle currently references a valid memory block.

    ReclaimReleasedPayloadBlocks()

    Reclaims any and all freed memory blocks from the "tail" of the RingBuffer.

    ReleasePayload(PayloadHandle)

    Releases the memory block referenced by the specified handle.

    RetrievePayloadFromHandle(PayloadHandle, bool, out NativeArray<byte>)

    Retrieves a NativeArray for the allocated memory block referenced by the specified handle.

    RetrievePayloadFromHandle(PayloadHandle, out NativeArray<byte>)

    Retrieves a NativeArray for the allocated memory block referenced by the specified handle.

    RoundToNextAlign(uint)

    Changes the input size to the size that is aligned to AlignTo bytes

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)