Is it safe to allocate UnsafeList inside job with Allocator.Persistent? I don’t have any warning/error, but also for NativeList/NativeArray i have “System.InvalidOperationException: Jobs can only create Temp memory”.
I can’t just switch it to Allocator.Temp because i need it during each frame and I use this in other jobs.
Also i don’t have any errors or bugs during gameplay but will it always stable?
Yes, you can do this for unsafe collections (when native containers resize inside job they doing exactly the same - reallocate memory with allocator they were initially allocated) or any of your manual allocations, you just should be sure that you properly will track the container lifecycle and wouldn’t get memory leaks.