更新时间:2023-11-10 14:15:34
正如 Vlad 指出,不要分配堆栈上有 50MB.
As Vlad pointed out, don't allocate 50MB on the stack.
但是,这一点没有实际意义,因为您不需要分配 任何 数据.尝试通过一次调用 std::reverse来替换整个代码片段代码>
:
But, the point is moot because you don't need to allocate any data. Try replacing your entire code fragment with a single call to std::reverse
:
std::reverse(&sound_data[0], &sound_data[track_samples]);
#include <algorithm>
.