[foreign-memaccess+abi] RFR: 8299181: PaddingLayout unable to return byteAlignment value

Per Minborg pminborg at openjdk.org
Mon Jan 16 13:52:30 UTC 2023


This PR proposes bit-aligning `PaddingLayout` to 8 by default as opposed to the current  value of 1.

More generally, the PR restricts `PaddingLayout` bit-alignment to non-negative values that are an even multiple of 8 (i.e. 0, 8, 16, ...). There are no mechanism to derive `VarHandle` objects for sub-byte access anyhow and trying to obtain a miss-aligned `VarHandle` would throw an exception. 

If integrated, all `MemoryLayout` types would be byte-aligned.

-------------

Commit messages:
 - Add copyright years
 - Use byte to store MemoryLayout variables
 - Require all bitSizes to be dividable by 8
 - Allow zero PaddingLayout elements
 - Make PaddingLayout always align to byte boundaries

Changes: https://git.openjdk.org/panama-foreign/pull/766/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=766&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8299181
  Stats: 192 lines in 9 files changed: 61 ins; 81 del; 50 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/766.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/766/head:pull/766

PR: https://git.openjdk.org/panama-foreign/pull/766


More information about the panama-dev mailing list