Skip to content

Commit b9dcea1

Browse files
authored
optimize the new setglobal! function (JuliaLang/julia#44753)
* add missing gc root for typed global assignment The codegen declares this is callee rooted (since we do not usually alllocate), but we might call jl_isa now, which could. The annotations on this function previously were incorrect. * test: make exports of modules check ignore Main Main exports everything, so it is not useful to include in this test. Refs: JuliaLang/julia#44740 * codegen: optimize setglobal like assignment Fixes some atomic ordering issues also where we were ignoring the argument. Uses the new builtin where we could. But also fixes some cases where we would allocate the global binding at the wrong time (which is a globally visible side-effect of compilation), or might throw from inside codegen accidentally there instead.
1 parent 3b57a49 commit b9dcea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clusterserialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function deserialize_global_from_main(s::ClusterSerializer, sym)
170170
if sym_isconst
171171
ccall(:jl_set_const, Cvoid, (Any, Any, Any), Main, sym, v)
172172
else
173-
ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, sym, v)
173+
setglobal!(Main, sym, v)
174174
end
175175
return nothing
176176
end

0 commit comments

Comments
 (0)