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

Correct padding of struct layouts #171

Merged
merged 1 commit into from
Jan 4, 2023
Merged

Conversation

keithc-ca
Copy link
Member

The size of padding elements in structure layouts should be alignment - (offset % alignment) bits wide (when offset is not a multiple of alignment).

See #166 (review); in draft mode pending testing results. FYI @ChengJin01.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
@ChengJin01
Copy link

I've verified this PR (only involves the test code) via Grinders at https://openj9-jenkins.osuosl.org/job/Grinder/1787/console on all supported platforms with all foreign-related jtreg test suites enabled in JDK17 at ChengJin01/aqa-tests@c9d4213#diff-a5bebf2d9c9f465d654db2bd952ac7e529903273ff5be89d00266afa96de08fd, which works good as expected.

FYI: @tajila, @pshipton

@ChengJin01
Copy link

ChengJin01 commented Jan 4, 2023

Please help forward-port this PR to JDK19 & JDKnext at https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/openj9/test/jdk/java/foreign/CallGeneratorHelper.java#L149 and https://github.com/ibmruntimes/openj9-openjdk-jdk/blob/openj9/test/jdk/java/foreign/CallGeneratorHelper.java#L149 given the calculation of the struct layout should remain the same regardless of java versions.

@pshipton pshipton merged commit e80551c into ibmruntimes:openj9 Jan 4, 2023
@keithc-ca keithc-ca deleted the padding branch January 4, 2023 21:13
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