示例#1
0
            public SharedData(int alignment)
            {
                BlankPage = UnsafeUtility.Malloc(DataPortDeclarations.k_MaxInputSize, alignment, Allocator.Persistent);
                UnsafeUtility.MemClear(BlankPage, DataPortDeclarations.k_MaxInputSize);

                SafetyManager = Utility.CAlloc <AtomicSafetyManager>(Allocator.Persistent);
                *SafetyManager = AtomicSafetyManager.Create();
            }
        public static AtomicSafetyManager Create()
        {
            var ret = new AtomicSafetyManager();

            ret.CreateTemporaryHandles();
            ret.m_IsCreated = 1;
            return(ret);
        }
示例#3
0
        unsafe JobHandle ProtectFenceFromECSTypes(JobHandle inputDeps)
        {
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            var componentSafetyManager = HostSystem.World.EntityManager.SafetyHandles;

            for (int i = 0; i < m_ActiveComponentTypes.Count; ++i)
            {
                m_ActiveComponentTypes[i].CopySafetyHandle(componentSafetyManager);
            }

            inputDeps = AtomicSafetyManager.MarkHandlesAsUsed(inputDeps, m_ActiveComponentTypes.Pointer, m_ActiveComponentTypes.Count);
#endif

            return(inputDeps);
        }