From 8e447ec7ec8f8024876b226cd551b0f3c4e8f7e3 Mon Sep 17 00:00:00 2001 From: Mark R Date: Mon, 20 Apr 2026 23:42:35 -0700 Subject: [PATCH] Update libbutl to match changes in libbuild2 see PR #522 in thee build2 repo. I would link it, but I don't know how to from the commandline. I added a minimum stack size. --- libbutl/builtin.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libbutl/builtin.cxx b/libbutl/builtin.cxx index 8365a935..0c7b28de 100644 --- a/libbutl/builtin.cxx +++ b/libbutl/builtin.cxx @@ -3034,6 +3034,10 @@ namespace butl sizeof(void*) * LIBBUTL_BUILTIN_DEFAULT_STACK_SIZE) #endif +#ifndef LIBBUTL_BUILTIN_MIN_STACK_SIZE +# define LIBBUTL_BUILTIN_MIN_STACK_SIZE 1048576 // 1MB +#endif + size_t stack_size; { // Don't forget to update #if condition in builtin.hxx when adding the @@ -3074,7 +3078,13 @@ namespace butl #endif } - // Cap the size if necessary. + // Clamp the size if necessary. + // + if (stack_size < LIBBUTL_BUILTIN_MIN_STACK_SIZE) + stack_size = LIBBUTL_BUILTIN_MIN_STACK_SIZE; + + // Note that --max-stack can be used set the stack size below + // LIBBUTL_BUILTIN_MIN_STACK_SIZE // if (max_stack) {