fix compile on windows:

- replace dynamic stack array with std::vector