When to use which Allocator?

It doesn’t seem to exist any official information on what does each Allocator type do. In fact only thing I could find in documentation is “Temporary job allocation.” for Allocator.Temp etc which seem a bit pathetic. I would like to use arrays in a chain of jobs, which Allocators should I use for them if they are used in more that one job?

Temp

  • can’t be passed to jobs but can be allocated in jobs.
  • automatically deallocated at end of frame or when job completes (if allocated in job)
    TempJob
  • can be passed to jobs
  • lasts 4 frames (but needs to be manually deallocated or warnings)
    Persistant
  • can be passed to jobs
  • lasts till disposed
7 Likes

To add tertle use persistant if you need an easy acces from other scripts and wont dispose it

Use temp if you will dispose in the same frame and use tempjob if you will pass it trough an job and after the job dispose