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.8 6.7 6.5 Change-Id: I1d1262a4048cf4b3fed8df813decc3e142430a32 Reviewed-by: Mate Barany <mate.barany@qt.io>
This commit is contained in:
parent
e275db9d88
commit
b2e0ff4bca
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user