Skip to content

Commit 8efde05

Browse files
staticfloatDilumAluthge
authored andcommitted
Consistently report sysimg size limits (JuliaLang#51119)
We used to be reporting the maximum system image size in hexadecimal, while reporting the image that was just built in decimal. This is a recipe for confusion when the size limit contains no blatantly hexadecimal characters. This PR addresses the issue by consistently printing out both values in hexadecimal (making this more obvious by prefixing the numbers with `0x`). In order to use `PRIxPTR` in both format strings, I have cast the current image size to `uintptr_t` from `intmax_t`, which should be safe in all situations. Co-authored-by: Dilum Aluthge <[email protected]>
1 parent f89197f commit 8efde05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/staticdata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,17 +1960,17 @@ static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED
19601960
if (sysimg.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)) {
19611961
jl_printf(
19621962
JL_STDERR,
1963-
"ERROR: system image too large: sysimg.size is %jd but the limit is %" PRIxPTR "\n",
1964-
(intmax_t)sysimg.size,
1963+
"ERROR: system image too large: sysimg.size is 0x%" PRIxPTR " but the limit is 0x%" PRIxPTR "\n",
1964+
(uintptr_t)sysimg.size,
19651965
((uintptr_t)1 << RELOC_TAG_OFFSET)
19661966
);
19671967
jl_exit(1);
19681968
}
19691969
if (const_data.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)) {
19701970
jl_printf(
19711971
JL_STDERR,
1972-
"ERROR: system image too large: const_data.size is %jd but the limit is %" PRIxPTR "\n",
1973-
(intmax_t)const_data.size,
1972+
"ERROR: system image too large: const_data.size is 0x%" PRIxPTR " but the limit is 0x%" PRIxPTR "\n",
1973+
(uintptr_t)const_data.size,
19741974
((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)
19751975
);
19761976
jl_exit(1);

0 commit comments

Comments
 (0)