Skip to content

Commit 86bc4c7

Browse files
authored
Fix segmentation fault on mingw (#457)
Fix segmentation fault on mingw Instead of using a stack-allocated variable, use an heap-allocated one.
1 parent 423ed67 commit 86bc4c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/mandelbrot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <cstdio>
1616
#include <iostream>
1717
#include <string>
18+
#include <vector>
1819

1920
#include "pico_bench.hpp"
2021

@@ -228,7 +229,7 @@ int main()
228229
const float y1 = 1;
229230
const int maxIters = 256;
230231

231-
alignas(64) std::array<int, width * height> buf;
232+
std::vector<int, xsimd::aligned_allocator<int, XSIMD_DEFAULT_ALIGNMENT>> buf(width * height);
232233

233234
auto bencher = pico_bench::Benchmarker<milliseconds>{64, seconds{10}};
234235

0 commit comments

Comments
 (0)