/// <summary>
        /// Increase the references count
        /// </summary>
        public int IncreaseReferences()
        {
            if (_source != null)
            {
                return(_source.IncreaseReferences());
            }

            return(Interlocked.Increment(ref _references));
        }
Example #2
0
        private void Add(ImmutableArrayInternal <T> array)
        {
            if (array.Length <= 0)
            {
                return;
            }

            array.IncreaseReferences();

            _arrays.Add(array);
            _offsets.Add(_length + array.Length);
            _length += array.Length;
        }