File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 17
17
- add maxerror to gifsave [dloebl]
18
18
- update libnsgif API [tlsa]
19
19
- deprecate "properties" option to dzsave (now always on)
20
+ - always set the min stack size for pthreads, if we can
20
21
21
22
26/11/21 started 8.12.3
22
23
- better arg checking for hist_find_ndim [travisbell]
Original file line number Diff line number Diff line change @@ -447,6 +447,7 @@ vips_init( const char *argv0 )
447
447
static gboolean started = FALSE;
448
448
static gboolean done = FALSE;
449
449
const char * vips_min_stack_size ;
450
+ gint64 min_stack_size ;
450
451
const char * prefix ;
451
452
const char * libdir ;
452
453
#ifdef ENABLE_NLS
@@ -468,6 +469,14 @@ vips_init( const char *argv0 )
468
469
return ( 0 );
469
470
started = TRUE;
470
471
472
+ /* Try to set a minimum stacksize, default 2mb. We need to do this
473
+ * before any threads start.
474
+ */
475
+ min_stack_size = 2 * 1024 * 1024 ;
476
+ if ( (vips_min_stack_size = g_getenv ( "VIPS_MIN_STACK_SIZE" )) )
477
+ min_stack_size = vips__parse_size ( vips_min_stack_size );
478
+ (void ) set_stacksize ( min_stack_size );
479
+
471
480
if ( g_getenv ( "VIPS_INFO" )
472
481
#if ENABLE_DEPRECATED
473
482
|| g_getenv ( "IM_INFO" )
@@ -665,11 +674,6 @@ vips_init( const char *argv0 )
665
674
if ( g_getenv ( "VIPS_BLOCK_UNTRUSTED" ) )
666
675
vips_block_untrusted_set ( TRUE );
667
676
668
- /* Set a minimum stacksize, if we can.
669
- */
670
- if ( (vips_min_stack_size = g_getenv ( "VIPS_MIN_STACK_SIZE" )) )
671
- (void ) set_stacksize ( vips__parse_size ( vips_min_stack_size ) );
672
-
673
677
done = TRUE;
674
678
675
679
vips__thread_gate_stop ( "init: startup" );
You can’t perform that action at this time.
0 commit comments