public void Expand(ExpandableArray <TKey> keyBuffer, ExpandableArray <TValue> valueBuffer) { Assert.Debug.Check(keyBuffer.Length > 0); Assert.Debug.Check(keyBuffer.Length == valueBuffer.Length); _keyBuffer.ExpandByRef(ref keyBuffer); _valueBuffer.ExpandByRef(ref valueBuffer); }
public ExpandableDictionary(Span <TKey> keys, Span <TValue> values) { Assert.Debug.Check(keys.Length > 0); Assert.Debug.Check(keys.Length == values.Length); _count = 0; _keyBuffer = keys; _valueBuffer = values; }
public ExpandableQueue(Span <TItem> buffer) { Assert.Debug.Check(buffer.Length > 0); _count = 0; _head = 0; _tail = 0; _buffer = buffer; }
public void Expand(ExpandableArray <TItem> array) { Assert.Debug.Check(array.Length > 0); if (_chunk.Next == null) { _chunk.Next = &array._chunk; return; } var nextChunk = _chunk.Next; while (true) { if (nextChunk->Next == null) { nextChunk->Next = &array._chunk; return; } } }
internal void ExpandByRef(ref ExpandableArray <TItem> array) { Assert.Debug.Check(array.Length > 0); fixed(ArrayChunk *chunkPtr = &array._chunk) { if (_chunk.Next == null) { _chunk.Next = chunkPtr; return; } var nextChunk = _chunk.Next; while (true) { if (nextChunk->Next == null) { nextChunk->Next = chunkPtr; return; } } } }
public ExpandableStack(Span <TItem> buffer) { Assert.Debug.Check(buffer.Length > 0); _count = 0; _buffer = buffer; }
public void Expand(ExpandableArray <TItem> buffer) { Assert.Debug.Check(buffer.Length > 0); _buffer.ExpandByRef(ref buffer); _tail = Capacity - 1; }