malloc and new aren't going to cause stack overflow. Assuming gcc implements vectors similar to microsoft, only a small header structure is used for a vector, and the data for the vector is allocated...