Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently report sysimg size limits #51119

Merged
merged 3 commits into from
Aug 31, 2023
Merged

Conversation

staticfloat
Copy link
Member

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.

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.
@staticfloat staticfloat requested a review from vtjnash August 30, 2023 18:29
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@staticfloat staticfloat added the merge me PR is reviewed. Merge when all tests are passing label Aug 30, 2023
@DilumAluthge DilumAluthge merged commit 479743e into master Aug 31, 2023
@DilumAluthge DilumAluthge deleted the sf/consistent_size_printing branch August 31, 2023 15:32
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Aug 31, 2023
nickrobinson251 pushed a commit to RelationalAI/julia that referenced this pull request Sep 21, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants