Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion libbutl/builtin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down