DeallocateOnJobCompletionAttribute
Automatically deallocates a native container when a job is finished.
Read time 3 minutesLast updated 9 days ago
Definition
- Type: Class
- Namespace: Unity.Collections
- Assembly: UnityEngine.CoreModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Field)]public sealed class DeallocateOnJobCompletionAttribute : Attribute
Remarks
Use this attribute on native container fields marked with NativeContainerSupportsDeallocateOnJobCompletionAttribute in a job struct. In particular, fields of type NativeArray can be automatically deallocated with this attribute. When the job finishes execution, the job system automatically deallocates the native container.
Additional Resources: NativeContainerSupportsDeallocateOnJobCompletionAttribute