Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Documentation/API Accessibility: NativeContainerAttribute example uses internal API in documentation

Discussion in '2022.2 Beta' started by Per-Morten, Jul 31, 2022.

  1. Per-Morten

    Per-Morten

    Joined:
    Aug 23, 2019
    Posts:
    109
    The example in the NativeContainerAttribute documentation on how to create safe native containers without using DisposeSentinel uses the functions CollectionHelper.CreateSafetyHandle and CollectionHelper.DisposeSafetyHandle. These functions are marked internal so they aren't accessible to us. It's not really possible to copy the code either, as CollectionHelper.DisposeSafetyHandle accesses the internal (I assume) field of AtomicSafetyHandle. It would be nice if these functions could be made public so we could use them the way the NativeContainerAttribute example uses them.

    In general, it would be nice if more of the CollectionHelper functions could be made public. A lot of them are convenience functions that it would be nice not to have to duplicate, such as AssumePositive, CheckIndexInRange, ShouldDeallocate, etc. Particularly for the functions that are conditionally compiled away if ENABLE_UNITY_COLLECTIONS_CHECKS isn't defined.
     
  2. bkaradzic-unity3d

    bkaradzic-unity3d

    Unity Technologies

    Joined:
    Jan 17, 2020
    Posts:
    17
    We fixed this issue, and current ETA is DOTS-1.0 (we might also backport it, in case we make another release before DOTS-1.0).
     
    Per-Morten likes this.