The Windows implementation of FileChannel::map seems incorrect, as it converts a jlong byte size into a DWORD, thus dropping 32 bits on the floor:
```
mapAddress = MapViewOfFile(
mapping, /* Handle of file mapping object */
mapAccess, /* Read and write access */
highOffset, /* High word of offset */
lowOffset, /* Low word of offset */
(DWORD)len); /* Number of bytes to map */ <------
```
This issue was discovered and reported in the panama-dev mailing list:
https://mail.openjdk.java.net/pipermail/panama-dev/2022-May/016977.html
Of course this was never an issue with MappedByteBuffer, whose size can never exceed 2^32.
```
mapAddress = MapViewOfFile(
mapping, /* Handle of file mapping object */
mapAccess, /* Read and write access */
highOffset, /* High word of offset */
lowOffset, /* Low word of offset */
(DWORD)len); /* Number of bytes to map */ <------
```
This issue was discovered and reported in the panama-dev mailing list:
https://mail.openjdk.java.net/pipermail/panama-dev/2022-May/016977.html
Of course this was never an issue with MappedByteBuffer, whose size can never exceed 2^32.
- relates to
-
JDK-8287526 java/nio/channels/FileChannel/LargeMapTest.java fails on 32-bit systems
-
- Resolved
-
-
JDK-8287154 java/nio/channels/FileChannel/LargeMapTest.java does not compile
-
- Resolved
-