Exemplo n.º 1
0
 internal Reader(ref UnsafeEventStream stream)
 {
     this.MBlockStream        = stream._blockData;
     this.MCurrentBlock       = null;
     this.MCurrentPtr         = null;
     this.MCurrentBlockEnd    = null;
     this.MRemainingItemCount = 0;
     this.MLastBlockSize      = 0;
 }
Exemplo n.º 2
0
        private static void Allocate(out NativeEventStream stream, Allocator allocator, bool useThreads)
        {
            ValidateAllocator(allocator);

            UnsafeEventStream.AllocateBlock(out stream._stream, allocator);

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            stream._useThreads = useThreads;
            DisposeSentinel.Create(out stream.m_Safety, out stream.m_DisposeSentinel, 0, allocator);
#endif
        }
 internal IndexWriter(ref UnsafeEventStream stream)
 {
     this.MBlockStream      = stream._blockData;
     this.MForeachIndex     = int.MinValue;
     this._mElementCount    = -1;
     this._mCurrentBlock    = null;
     this._mCurrentBlockEnd = null;
     this._mCurrentPtr      = null;
     this._mFirstBlock      = null;
     this._mNumberOfBlocks  = 0;
     this._mFirstOffset     = 0;
     this._mThreadIndex     = 0;
 }
Exemplo n.º 4
0
            internal ThreadWriter(ref UnsafeEventStream stream)
            {
                this.MBlockStream  = stream._blockData;
                this._mThreadIndex = 0; // 0 so main thread works

                Assert.AreEqual(MBlockStream->RangeCount, JobsUtility.MaxJobThreadCount);

                for (var i = 0; i < JobsUtility.MaxJobThreadCount; i++)
                {
                    this.MBlockStream->Ranges[i].ElementCount       = 0;
                    this.MBlockStream->Ranges[i].NumberOfBlocks     = 0;
                    this.MBlockStream->Ranges[i].OffsetInFirstBlock = 0;
                    this.MBlockStream->Ranges[i].Block      = null;
                    this.MBlockStream->Ranges[i].LastOffset = 0;

                    this.MBlockStream->ThreadRanges[i].CurrentBlock    = null;
                    this.MBlockStream->ThreadRanges[i].CurrentBlockEnd = null;
                    this.MBlockStream->ThreadRanges[i].CurrentPtr      = null;
                }
            }