If not, how can we code a struct that can? My use case is a struct that contains two NativeArrays and implements IDisposable. It implements the Dispose() method that calls Dispose() on the two NativeArrays
Unless there’s some goofy hierarchy traversing with that attribute (Not the case with [NativeDisableParallelForRestriction]), you will have to create a dedicated dispose job that unpacks the struct and uses the [DeallocateOnJobCompletion] on each internal array.
1 Like