文档

Unity Engine

Unity Engine

Create(FixedString32Bytes, FixedString64Bytes, Allocator)

Creates a memory label with the specified area name, object name, and allocator.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule
public static MemoryLabel Create(FixedString32Bytes areaName, FixedString64Bytes objectName, Allocator allocator = Allocator.Persistent)

Parameters

The name of the memory area.

The name of the object being labeled.

allocator

The allocator to use. Defaults to Allocator.Persistent. Only Allocator.Persistent and Allocator.Domain support memory labeling.

Returns

Type

Description

MemoryLabelThe created memory label.

Remarks

This method can be used in Burst-compiled code with names that are not compile-time string literals.
Attempting to create a memory label with empty strings for the area name or object name, or with an unsupported allocator, throws an exception.