Refactor: Replace malloc savedots with std::vector