Skip to content

Commit 0dc3f3e

Browse files
committed
Workaround: bring back max-length pointer sequence layout
1 parent 5866149 commit 0dc3f3e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

SwiftKit/src/main/java/org/swift/swiftkit/SwiftValueLayout.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ public static long addressByteSize() {
4141
public static final ValueLayout.OfLong SWIFT_INT64 = ValueLayout.JAVA_LONG;
4242
public static final ValueLayout.OfFloat SWIFT_FLOAT = ValueLayout.JAVA_FLOAT;
4343
public static final ValueLayout.OfDouble SWIFT_DOUBLE = ValueLayout.JAVA_DOUBLE;
44-
public static final AddressLayout SWIFT_POINTER = ValueLayout.ADDRESS;
45-
// .withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, JAVA_BYTE));
44+
45+
// FIXME: this sequence layout is a workaround, we must properly size pointers when we get them.
46+
public static final AddressLayout SWIFT_POINTER = ValueLayout.ADDRESS
47+
.withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, JAVA_BYTE));
4648
public static final SequenceLayout SWIFT_BYTE_ARRAY = MemoryLayout.sequenceLayout(8, ValueLayout.JAVA_BYTE);
4749

4850
/**

0 commit comments

Comments
 (0)