Skip to content

Commit 424471f

Browse files
JeffBezansonKristofferC
authored andcommitted
fix trimming size regression due to handling binding backedges in the wrong place (#57927)
(cherry picked from commit fe613d4)
1 parent 81970b6 commit 424471f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/staticdata.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ static void jl_queue_module_for_serialization(jl_serializer_state *s, jl_module_
841841
// ... or point to Base functions accessed by the runtime
842842
(m == jl_base_module && (!strcmp(jl_symbol_name(b->globalref->name), "wait") ||
843843
!strcmp(jl_symbol_name(b->globalref->name), "task_done_hook"))))) {
844-
record_field_change((jl_value_t**)&b->backedges, NULL);
845844
jl_queue_for_serialization(s, b);
846845
}
847846
}
@@ -1081,6 +1080,9 @@ static void jl_insert_into_serialization_queue(jl_serializer_state *s, jl_value_
10811080
record_field_change((jl_value_t **)&tn->mt, NULL);
10821081
}
10831082
}
1083+
else if (jl_is_binding(v)) {
1084+
record_field_change((jl_value_t**)&((jl_binding_t*)v)->backedges, NULL);
1085+
}
10841086
}
10851087
char *data = (char*)jl_data_ptr(v);
10861088
size_t i, np = layout->npointers;

test/trimming/trimming.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let exe_suffix = splitext(Base.julia_exename())[2]
44

55
hello_exe = joinpath(@__DIR__, "hello" * exe_suffix)
66
@test readchomp(`$hello_exe`) == "Hello, world!"
7-
@test filesize(hello_exe) < filesize(unsafe_string(Base.JLOptions().image_file))/10
7+
@test filesize(hello_exe) < 2_000_000
88

99
basic_jll_exe = joinpath(@__DIR__, "basic_jll" * exe_suffix)
1010
lines = split(readchomp(`$basic_jll_exe`), "\n")

0 commit comments

Comments
 (0)