From 39c13f062a859d17b5be3a2a02fece8d0b1819f1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 27 Apr 2023 11:24:59 +0200 Subject: [PATCH] lib:talloc: Increase alloc size to 128 kilobytes We want to avoid that the optimizer will use stack allocations. This way the test should be a bit more realistic. Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- lib/talloc/testsuite.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c index a4a3f4e89d1..a305e5c09da 100644 --- a/lib/talloc/testsuite.c +++ b/lib/talloc/testsuite.c @@ -859,6 +859,10 @@ static bool test_unref_reparent(void) return true; } +/* Make the size big enough to not fit into the stack */ +#define ALLOC_SIZE (128 * 1024) +#define ALLOC_DUP_STRING "talloc talloc talloc talloc talloc talloc talloc" + /* measure the speed of talloc versus malloc */ @@ -878,9 +882,9 @@ static bool test_speed(void) do { void *p1, *p2, *p3; for (i=0;i