Skip to content

Commit 828e3a1

Browse files
authored
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.
1 parent 0947114 commit 828e3a1

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
@@ -3266,9 +3266,9 @@ void jl_init_types(void) JL_GC_DISABLED
32663266
jl_svec(5, jl_any_type,
32673267
jl_ulong_type, jl_ulong_type, jl_any_type/*jl_binding_partition_type*/, jl_ulong_type),
32683268
jl_emptysvec, 0, 1, 0);
3269-
const static uint32_t binding_partition_atomicfields[] = { 0b01111 }; // Set fields 1, 2, 3, 4 as atomic
3269+
const static uint32_t binding_partition_atomicfields[] = { 0b01110 }; // Set fields 2, 3, 4 as atomic
32703270
jl_binding_partition_type->name->atomicfields = binding_partition_atomicfields;
3271-
const static uint32_t binding_partition_constfields[] = { 0x100001 }; // Set fields 1, 5 as constant
3271+
const static uint32_t binding_partition_constfields[] = { 0b10001 }; // Set fields 1, 5 as constant
32723272
jl_binding_partition_type->name->constfields = binding_partition_constfields;
32733273

32743274
jl_binding_type =

0 commit comments

Comments
 (0)