allocate memory for ‘vals’ in vector on creation or copy