diff --git a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp index 99c15f6317b..6ea09171121 100644 --- a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp @@ -59,7 +59,13 @@ inline void allocator() // prepare OS (no other tasks, CPU and RAM reservations) to run this test, or use // instruction counting which seems to be less fragile. - const int count = 256 * 1024; +#ifdef Q_OS_WIN + // Stack space available is 1MB, but each pointer is 8 bytes, so leave us + // 32KB space to work with: + constexpr int count = 124 * 1024; +#else + constexpr int count = 256 * 1024; +#endif QScopedPointer objects[count]; QBENCHMARK_ONCE {