Reuse allocated memory when possible.