NativeDisableUnsafePtrRestrictionAttribute

class in Unity.Collections.LowLevel.Unsafe

/

Implemented in:UnityEngine.CoreModule

Description

Enable the use of unsafe pointers in jobs.

By default, unsafe pointers aren't allowed in jobs because it isn't possible for the Job Debugger to gurantee race condition free behavior. This attribute lets you explicitly disable the restriction on a job.

struct MyJob : IJob
{
    [NativeDisableUnsafePtrRestriction]
    int* myCustomPointer;

void Execute() { ... } }

Did you find this page useful? Please give it a rating: