Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize the entry-point for Julia execution #50974

Merged
merged 6 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Silence analyzegc flase positive, incorporate formatting review
  • Loading branch information
Keno committed Aug 29, 2023
commit e6bf0182fcca581604947659e89c14a36d5cbe9b
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Command-line option changes
(i.e. using `julia script.jl` or `julia -e expr`), julia will subsequently run the `Main.main` function automatically if
such a function has been defined. This is identended to unify script and compilation workflows, where code loading may happen
Keno marked this conversation as resolved.
Show resolved Hide resolved
in the compiler and execution of `Main.main` may happen in the resulting executable. For interactive use, there is no semantic
difference between defining a main function and executing the code directly at the end of the script. ([50974])
difference between defining a `main` function and executing the code directly at the end of the script. ([50974])

Multi-threading changes
-----------------------
Expand Down
3 changes: 2 additions & 1 deletion src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ static NOINLINE int true_main(int argc, char *argv[])
size_t last_age = ct->world_age;
ct->world_age = jl_get_world_counter();
jl_value_t *r = jl_apply(&start_client, 1);
jl_typeassert(r, (jl_value_t *)jl_int32_type);
if (jl_typeof(r) != (jl_value_t*)jl_int32_type)
jl_type_error("typeassert", (jl_value_t*)jl_int32_type, r);
ret = jl_unbox_int32(r);
ct->world_age = last_age;
}
Expand Down