tst_bench_qobject: Fix stdAllocator case for Windows

The total stack space available is 1MB, but each pointer is 8 bytes.
So we have to limit the amount of pointers we allocate on the stack to
somewhere below 128K.

Pick-to: 6.7 6.5
Change-Id: I1d1262a4048cf4b3fed8df813decc3e142430a32
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit b2e0ff4bca5d81205c8425cdc528e5c2a2988172)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2024-09-06 15:04:06 +02:00 committed by Qt Cherry-pick Bot
parent 8d83abfaf7
commit 582eaaaa68

View File

@ -59,7 +59,13 @@ inline void allocator()
// prepare OS (no other tasks, CPU and RAM reservations) to run this test, or use // prepare OS (no other tasks, CPU and RAM reservations) to run this test, or use
// instruction counting which seems to be less fragile. // 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<T> objects[count]; QScopedPointer<T> objects[count];
QBENCHMARK_ONCE { QBENCHMARK_ONCE {