File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -462,9 +462,23 @@ int main_program(int argc, char **argv)
462462
463463#ifdef USE_VICE_THREAD
464464
465- if (pthread_create (& vice_thread , NULL , vice_thread_main , NULL )) {
466- log_fatal (main_log , "failed to launch main thread" );
467- return 1 ;
465+ {
466+ /*
467+ * On macOS, pthreads have a default stack size of 512KB. Linux
468+ * pthreads use 8MB by default. Since we have code in wic64 that
469+ * uses ~1MB temp stack buffers, we explicitly set the VICE thread
470+ * stack size to 8MB to bring all platforms in line with Linux.
471+ */
472+
473+ pthread_attr_t attr ;
474+ size_t stacksize = 8 * 1024 * 1024 ;
475+ pthread_attr_init (& attr );
476+ pthread_attr_setstacksize (& attr , stacksize );
477+
478+ if (pthread_create (& vice_thread , & attr , vice_thread_main , NULL )) {
479+ log_fatal (main_log , "failed to launch main thread" );
480+ return 1 ;
481+ }
468482 }
469483
470484 pthread_mutex_unlock (& init_lock );
You can’t perform that action at this time.
0 commit comments