Use Vec instead of fixed size array

unsafe set_len is used to avoid memory initialization