Skip to content

Commit 6a16596

Browse files
vtjnashKristofferC
authored andcommitted
staticdata: fix many mistakes in staticdata stripping (#58166)
While #58156 was supposed to be fairly trivial, it ended up uncovering many bugs in the unusual ways that trimming and binding partition had been added to the serialization format. This attempts to reorganize them to be handled more consistently and with fewer mistakes. (cherry picked from commit 828e3a1)
1 parent dd50abb commit 6a16596

File tree

5 files changed

+178
-125
lines changed

5 files changed

+178
-125
lines changed

contrib/generate_precompile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
# Prevent this from putting anything into the Main namespace
4-
@eval Core.Module() begin
4+
@eval Base module __precompile_script
55

66
if Threads.maxthreadid() != 1
77
@warn "Running this file with multiple Julia threads may lead to a build error" Threads.maxthreadid()

src/jltypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,9 +3267,9 @@ void jl_init_types(void) JL_GC_DISABLED
32673267
jl_svec(5, jl_any_type,
32683268
jl_ulong_type, jl_ulong_type, jl_any_type/*jl_binding_partition_type*/, jl_ulong_type),
32693269
jl_emptysvec, 0, 1, 0);
3270-
const static uint32_t binding_partition_atomicfields[] = { 0b01111 }; // Set fields 1, 2, 3, 4 as atomic
3270+
const static uint32_t binding_partition_atomicfields[] = { 0b01110 }; // Set fields 2, 3, 4 as atomic
32713271
jl_binding_partition_type->name->atomicfields = binding_partition_atomicfields;
3272-
const static uint32_t binding_partition_constfields[] = { 0x100001 }; // Set fields 1, 5 as constant
3272+
const static uint32_t binding_partition_constfields[] = { 0b10001 }; // Set fields 1, 5 as constant
32733273
jl_binding_partition_type->name->constfields = binding_partition_constfields;
32743274

32753275
jl_binding_type =

0 commit comments

Comments
 (0)