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
Inherited Members
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()