docs.unity3d.com
    Show / Hide Table of Contents

    Class ManagedStackTraceWrapper

    Static class to deal with StackTrace capturing. Includes managed function pointers that can be called from Burst code. It also provides a way to defer analysis of the stack trace for faster performance.

    Used from the codegen StackTraceCapture

    Inheritance
    Object
    ManagedStackTraceWrapper
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Logging.Internal
    Syntax
    public static class ManagedStackTraceWrapper

    Fields

    CaptureStackTraceFuncName1

    Declaration
    public static readonly string CaptureStackTraceFuncName1
    Field Value
    Type Description
    String

    CaptureStackTraceFuncName2

    Declaration
    public static readonly string CaptureStackTraceFuncName2
    Field Value
    Type Description
    String

    Methods

    AppendToUnsafeText(Int64, ref UnsafeText)

    Appends text representation of the stack trace that was captured with Capture() to UnsafeText

    Declaration
    public static void AppendToUnsafeText(long id, ref UnsafeText result)
    Parameters
    Type Name Description
    Int64 id

    Id of the captured stacktrace

    UnsafeText result

    UnsafeText where to append the stacktrace's text representation

    AssertNoAllocatedResources()

    Debug function. Asserts is there are any Captured and not Freed stack traces. Capture() Free(Int64)

    Declaration
    public static void AssertNoAllocatedResources()

    Capture()

    Captures a stack trace and returns its id Can be called from burst (if Initialize() was called before) or not burst

    Declaration
    public static long Capture()
    Returns
    Type Description
    Int64

    Id of the captured stacktrace

    ForceClearAll()

    Debug function. Force clears all Captured stacktraces if any. Invalidates all ids captured before, so it is not safe to call AppendToUnsafeText(Int64, ref UnsafeText) on any ids captured before. Capture() Free(Int64)

    Declaration
    public static void ForceClearAll()

    Free(Int64)

    Releases captured stack trace that was captured with Capture() Can be called from burst (if Initialize() was called before) or not burst

    Declaration
    public static void Free(long id)
    Parameters
    Type Name Description
    Int64 id

    Id of the captured stacktrace to release

    Initialize()

    Initializes everything needed for StackTraces to be captured. Should be called from managed (non-burst) environment

    Declaration
    [BurstDiscard]
    public static void Initialize()
    Back to top
    Terms of use
    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