2 writes to _stack
System.Text.Json (2)
System\Text\Json\Serialization\WriteStack.cs (2)
136_stack = new WriteStackFrame[4]; 140Array.Resize(ref _stack, 2 * _stack.Length);
23 references to _stack
System.Text.Json (23)
System\Text\Json\Serialization\WriteStack.cs (23)
36Debug.Assert(_stack is not null); 37return ref _stack[_count - _indexOffset - 1]; 134if (_stack is null) 138else if (_count - _indexOffset == _stack.Length) 140Array.Resize(ref _stack, 2 * _stack.Length); 205_stack[_count - _indexOffset] = Current; 220Current = _stack[_count - _indexOffset]; 266_stack[currentIndex + 1] = Current; 267Current = _stack[currentIndex]; 275Current = _stack[_count - _indexOffset]; 320if (_stack is not null) 326Debug.Assert(_stack[i].AsyncDisposable is null); 331Debug.Assert(_stack[i].CollectionEnumerator is null || ReferenceEquals(Current.CollectionEnumerator, _stack[i].CollectionEnumerator)); 335DisposeFrame(_stack[i].CollectionEnumerator, ref exception); 370if (_stack is not null) 380Debug.Assert(_stack[i].CollectionEnumerator is null || ReferenceEquals(Current.CollectionEnumerator, _stack[i].CollectionEnumerator)); 381Debug.Assert(_stack[i].AsyncDisposable is null || ReferenceEquals(Current.AsyncDisposable, _stack[i].AsyncDisposable)); 385exception = await DisposeFrame(_stack[i].CollectionEnumerator, _stack[i].AsyncDisposable, exception).ConfigureAwait(false); 434AppendStackFrame(sb, ref _stack[i - _indexOffset]);