// Pushes an item to the top of the stack. // /// <include file='doc\Stack.uex' path='docs/doc[@for="Stack.Push"]/*' /> public void Push(T item) { if (_size == _array.Length) { T[] newArray = new T[(_array.Length == 0) ? _defaultCapacity : 2*_array.Length]; Array.Copy(_array, 0, newArray, 0, _size); _array = newArray; } _array[_size++] = item; _version++; }
스택이 가득찼는데 Push할때 말고는 메모리할당 없음
스택이 가득찼는데 Push할때 말고는 메모리할당 없음
ㅅㅂ 깨지는구나
https://referencesource.microsoft.com/#System/compmod/system/collections/generic/stack.cs,c5371bef044c6ab6
링크
직접 가서 검색해보셈
당연히 push 할때 말고는 메모리할당이 안되지 그럼 부동산에서 집2개산후 세입자 나가면 집없어짐?
니가 push할때마다 메모리얼락이 생긴다며...
뭔 얘기가 하고싶었던거임?