/// <summary> /// Constructs an instance with the given capacity rounded up to /// the next power-of-2 value. /// </summary> /// <param name="capacity">The target capacity.</param> public SpscLinkedArrayQueue(int capacity) { int c = QueueHelper.Round(capacity < 2 ? 2 : capacity); mask = c - 1; consumerArray = producerArray = new Entry[c]; Volatile.Write(ref consumerIndex, 0L); // FIXME not sure if C# constructor with readonly field does release or not }
/// <inheritdoc/> public void Clear() { QueueHelper.Clear(this); }