Skip to content

Commit

Permalink
Use a thread stack size of 256kb
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Oct 5, 2023
1 parent 090c927 commit 79de0d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libvips/iofuncs/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ set_stacksize(guint64 size)
pthread_attr_t attr;
size_t cur_stack_size;

/* Don't allow stacks less than 2mb.
/* Don't allow stacks less than 256kb.
*/
size = VIPS_MAX(size, 2 * 1024 * 1024);
size = VIPS_MAX(size, 256 * 1024);

if (pthread_attr_init(&attr) ||
pthread_attr_getstacksize(&attr, &cur_stack_size)) {
Expand Down Expand Up @@ -483,10 +483,10 @@ vips_init(const char *argv0)
return 0;
started = TRUE;

/* Try to set a minimum stacksize, default 2mb. We need to do this
/* Try to set a minimum stacksize, default 256kb. We need to do this
* before any threads start.
*/
min_stack_size = 2 * 1024 * 1024;
min_stack_size = 256 * 1024;
if ((vips_min_stack_size = g_getenv("VIPS_MIN_STACK_SIZE")))
min_stack_size = vips__parse_size(vips_min_stack_size);
(void) set_stacksize(min_stack_size);
Expand Down

0 comments on commit 79de0d3

Please sign in to comment.