Skip to content

Commit

Permalink
coroutines: reduce default stack size from 8 MB to 8 KB
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed May 21, 2024
1 parent 0963069 commit 458aab4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vlib/coroutines/coroutines.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/gen/c/spawn_and_go.v
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 458aab4

Please sign in to comment.