com.unity.collections 2.1.0-exp.4

com.unity.collections

Notes: processedReleased August 31, 2022

Browse versions

PreviousNext

Unity Compatibility

Minimum Unity: 2022.2 (0b5)

Features

  • `Native/Unsafe/FixedList.InsertRange` with index/count arguments.
  • StreamCompressionModel moved from com.unity.transport
  • DataStreamReader moved from com.unity.transport
  • DataStreamWriter moved from com.unity.transport
  • Job types depending on collections have been moved here
  • Burst compiled delegates for allocators are now cached, which avoids a costly re-compilation
  • `DataStreamReader` can now be passed to a job
  • `DataStreamReader` can now be passed to a job.
  • IJobParallelForBatch from com.unity.jobs
  • `Unsafe/NativeHashMap/Set` suitable for single-threaded use cases.
  • `Native/UnsafeHashSet.ReadOnly` and `Native/UnsafeParallelHashSet.ReadOnly`.
  • `ConvertExistingDataToNativeArray` in `CollectionHelper` for custom allocators.
  • `Native/UnsafeBitArray.ReadOnly`.
  • CopyFromTruncated for one FixedStringXXXBytes to another FixedStringYYYBytes
  • New method `AddReplicate` to `NativeList`, `UnsafeList` and all `FixedList`, which will add a value `count` times to the list.
  • `CollectionHelper.CreateSafetyHandle` and `CollectionHelper.DisposeSafetyHandle` are public APIs now.

📈 Improvements

  • T constraint on all containers from `struct` to `unmanaged`
  • Add the missing string interpolation operator in two memory exception messages and make the message clearer.
  • Awareness of newly supported nested containers
  • Faster FixedString comparison
  • Reset `m_best` in RewindableAllocator rewind.
  • IJobParallelForFilter renamed to IJobFilter to better reflect functionality
  • Ensure lazy initialization of IJob types
  • Change Bool type, `m_enableBlockFree` in `RewindableAllocator` to Byte type.
  • Change the growth rate of memory block size in RewindableAllocator.
  • FixedList methods `AddRange` and `AddRangeNoResize` will no longer append elements if they would exceed capacity.

🔧 Bug Fixes

  • Some `AssumePositive` assumptions that should have been after some safety checks but weren't.
  • `Native/UnsafeList.InsertRangeWithBeginEnd` to allow end argument to resize list.
  • Fixed a race condition in the parallel hashmap when using `ParallelWriter` with hashmaps that operate close to their capacity
  • Update documentation on existing DataStream structs and helper methods.
  • Don't cache `DataStreamWriter.IsLittleEndian`, as the cache could not be properly populated if its shared static was not 0-initialized.

API Changes

  • DisposeSentinel usage in containers.
  • deprecated code untyped `UnsafeList`, and `WordStorage`.
  • All deprecated code.
  • Temporary NativeArray placeholder
  • ### Deprecated
  • NetworkCompressionModel. New type StreamCompressionModel is no longer IDisposable and all usage of this should use the SharedStatic reference instead.
  • Packed read and write methods that take NetworkCompressionModel as a parameter. New versions taking StreamCompressionModel as an argument should be used instead.
  • `UnsafeList.ParallelReader` replaced by `UnsafeList.ReadOnly`.
  • `NativeList.AsParallelReader()` replaced by `NativeList.AsReadOnly()`.
  • Implicit cast operator from `NativeList` to `NativeArray`. Explicit cast method `NativeList.AsArray()` should be used instead.