Introduce conversion size to index in integers - #7986
Merged
Conversation
Contributor
Author
|
@amicic Would you please review? |
amicic
reviewed
Oct 15, 2025
| */ | ||
| MMINLINE static uintptr_t sizeToIndex(uintptr_t size) | ||
| { | ||
| uintptr_t msb = (J9BITS_BITS_IN_SLOT - 1) - MM_Bits::trailingZeroes(size); |
Contributor
There was a problem hiding this comment.
out of scope for this change, but should eventually rename this macro to OMRBITS_BITS_IN_SLOT
amicic
reviewed
Oct 15, 2025
| sizeClass = MM_Math::indexToSize(MM_Math::sizeToIndex(allocateSize) + 1); | ||
| } else { | ||
| // to do: remove comment: this is not exactly what was used before but semantically close | ||
| // uintptr_t sizeClass = (uintptr_t)(powf(_sizeClassRatio, (float)ceil(logf((float)allocateSize) * _sizeClassRatioLogInversed))); |
Contributor
|
@babsingh please review/merge |
amicic
approved these changes
Oct 15, 2025
Signed-off-by: Dmitri Pivkine <Dmitri_Pivkine@ca.ibm.com>
dmitripivkine
force-pushed
the
modifyLOAS
branch
from
October 15, 2025 21:20
e782c94 to
17c4d6f
Compare
Contributor
|
jenkins build all |
Contributor
Author
|
I don't think failure is related to the change: |
babsingh
approved these changes
Oct 16, 2025
babsingh
left a comment
Contributor
There was a problem hiding this comment.
The above PR build failure is known and unrelated to this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introducing simplified size-to-index and index-to-size functions using calculations in integers and making it enabled by default. Old calculation in Float Point math is preserved and can be activated is necessary.
Calculation in integers using hardcoded log base ~1.189 instead of 1.2 for FP. This hardcoded log base can not be changed, so log base parameter is ignored.