@SuppressWarnings("unchecked")
	@Override
    protected void doEnsureCapacity(int minCapacity) {
		// Note: Same behavior as in ArrayList.ensureCapacity()
		int oldCapacity = values.length;
		if (minCapacity <= oldCapacity) {
			return;	// do not shrink
		}
        minCapacity = Math.max(DEFAULT_CAPACITY, minCapacity);
	    int newCapacity = (oldCapacity*3)/2 + 1;
	    if (newCapacity < minCapacity) {
	    	newCapacity = minCapacity;
    	}

		E[] newValues = (E []) new Object[newCapacity];
		if (size == 0) {
			;
		} else if (start == 0) {
	        System.arraycopy(values, 0, newValues, 0, values.length);

		} else if (start > 0) {
			int grow = newCapacity-values.length;
			newValues = (E []) new Object[newCapacity];
			System.arraycopy(values, 0, newValues, 0, start);
			System.arraycopy(values, start, newValues, start+grow, values.length-start);
			if (gapStart > start && gapSize > 0) {
				gapStart += grow;
			}
			if (end > start) {
				end += grow;
			}
			start += grow;
		}
		if (end == 0 && start == 0 && size != 0) {
			// S1, S6
			end = values.length;
		}
		values = newValues;

		if (DEBUG_DUMP) debugDump();
		if (DEBUG_CHECK) debugCheck();
	}
Move a range of elements in the values array.
The elements are first copied and the source range is then
filled with null.

@param src	start index of source range
@param dst	start index of destination range
@param len	number of elements to move
jphp-runtime/src/php/runtime/memory/support/GapList.java