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

mspec updates through 202411051711 #70

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Conversation

headius
Copy link
Contributor

@headius headius commented Nov 5, 2024

No description provided.

XrXr and others added 4 commits November 5, 2024 11:08
…r#size

What a "word" is when talking about sizes is confusing because it's a
highly overloaded term. Intel, Microsoft, and GDB are just a few vendors
that have their own definition of what a "word" is. Specs that used the
"wordsize" guard actually were mostly testing for the size of the C
`long` fundamental type, so rename the guard for clarity.

Also, get the size of `long` directly from RbConfig instead of guessing
using Integer#size. Integer#size is not guaranteed to have anything to
do with the `long` type.
There is no guarantee that Integer#size will continue to return
`sizeof(long)` for small integers.

Use the `l!` specifier for Array#pack instead. It is a public
interface that has a direct relationship with the `long` type.
It's better than guessing based on the pointer size if the
implementation provides it directly.
These were removed by CRuby but that breaks running older rubyspec
with new mspec. We restore them here while the change propagates
into rubyspec.
@headius
Copy link
Contributor Author

headius commented Nov 5, 2024

@eregon Please review. The wordsize logic could also just be left in place, aliased to c_long_size but I chose to deprecate it in deference to CRuby.

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Thank you, this looks good, and I think it's worth keeping the word_size stuff a bit longer, deprecating it should be enough to avoid having new usages.

lib/mspec/helpers/numeric.rb Show resolved Hide resolved
@eregon eregon merged commit c9cc4b4 into ruby:master Nov 5, 2024
9 checks passed
@headius headius deleted the mri-rebased branch November 5, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants