From 458aab4820bb9eb8e12b2c5526519d4e4273de3a Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 21 May 2024 06:07:03 +0300 Subject: [PATCH] coroutines: reduce default stack size from 8 MB to 8 KB --- vlib/coroutines/coroutines.c.v | 2 +- vlib/v/gen/c/spawn_and_go.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/coroutines/coroutines.c.v b/vlib/coroutines/coroutines.c.v index 0c3435c445..8ad961ff4a 100644 --- a/vlib/coroutines/coroutines.c.v +++ b/vlib/coroutines/coroutines.c.v @@ -30,7 +30,7 @@ fn C.photon_set_log_output_stderr() fn C.photon_set_log_output_null() fn C.photon_join_current_thread_into_workpool() int fn C.photon_thread_create_and_migrate_to_work_pool(f voidptr, arg voidptr) -fn C.photon_thread_create(f voidptr, arg voidptr) +fn C.photon_thread_create(f voidptr, arg voidptr, stack_size u64) fn C.photon_thread_migrate() // fn C.photon_thread_migrate(work_pool voidptr) diff --git a/vlib/v/gen/c/spawn_and_go.v b/vlib/v/gen/c/spawn_and_go.v index fe302e6cdb..fdf154171a 100644 --- a/vlib/v/gen/c/spawn_and_go.v +++ b/vlib/v/gen/c/spawn_and_go.v @@ -164,7 +164,7 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) { if util.nr_jobs > 1 { g.writeln('photon_thread_create_and_migrate_to_work_pool((void*)${wrapper_fn_name}, &${arg_tmp_var});') } else { - g.writeln('photon_thread_create((void*)${wrapper_fn_name}, &${arg_tmp_var});') + g.writeln('photon_thread_create((void*)${wrapper_fn_name}, &${arg_tmp_var}, 8 * 1024);') } } g.writeln('// end go')