Version: 2023.2
언어: 한국어

AtomicSafetyHandle.CheckGetSecondaryDataPointerAndThrow

매뉴얼로 전환
public static void CheckGetSecondaryDataPointerAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle);

파라미터

handle The AtomicSafetyHandle to check.

설명

Check if the data pointer is in a valid state to be aliased by a view on the container which will use the secondary version number.

When implementing container methods which create memory-aliasing views, such as GetEnumerator or AsArray, use this method to check that it is safe to copy the pointer to the container's backing memory into the new view structure.

This is different to AtomicSafetyHandle.CheckReadAndThrow because that method will throw if there is a pending job which is writing to the container; this method will not throw if the job which is writing to the container is doing so through a handle which uses the secondary version. The difference is that in the latter case the job cannot affect the size of the container, and so there is no risk of it reallocating the container's backing memory and causing the data pointer copied to the view to become invalid.

For more information about container version numbers, see Copying NativeContainer structures.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961