Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #44 from ChengJin01/fix_alignment_long_and_pointer…
Browse files Browse the repository at this point in the history
…_aix_jdk19

Fix the alignment issue with long & pointer on AIX
  • Loading branch information
tajila authored Nov 1, 2022
2 parents cef044b + 841354b commit 165f4c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private AIX() {
/**
* The {@code long long} native type.
*/
public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(32);
public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64);

/**
* The {@code float} native type.
Expand All @@ -384,7 +384,7 @@ private AIX() {
/**
* The {@code T*} native type.
*/
public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(32);
public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64);

/**
* The {@code va_list} native type, as it is passed to a function.
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/java/foreign/NativeTestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static boolean isPointer(MemoryLayout layout) {
/**
* The layout for the {@code long long} C type.
*/
public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(isAixOS ? 32 : 64);
public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64);
/**
* The layout for the {@code float} C type
*/
Expand All @@ -89,7 +89,7 @@ public static boolean isPointer(MemoryLayout layout) {
/**
* The {@code T*} native type.
*/
public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(isAixOS ? 32 : 64);
public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64);

private static Linker LINKER = Linker.nativeLinker();

Expand Down

0 comments on commit 165f4c2

Please sign in to comment.