The Vec setSize(newSize) method should follow these steps: