mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8286734: (fc) FileChannelImpl#map() cleanup after merge of Foreign Function & Memory API
Reviewed-by: alanb
This commit is contained in:
parent
0c5ab6daa9
commit
5bea46110c
1 changed files with 12 additions and 8 deletions
|
@ -1014,6 +1014,10 @@ public class FileChannelImpl
|
|||
unmap();
|
||||
}
|
||||
|
||||
public long capacity() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
public void unmap() {
|
||||
if (address == 0)
|
||||
return;
|
||||
|
@ -1126,15 +1130,15 @@ public class FileChannelImpl
|
|||
else
|
||||
return Util.newMappedByteBuffer(0, 0, dummy, null, isSync);
|
||||
} else if ((!writable) || (prot == MAP_RO)) {
|
||||
return Util.newMappedByteBufferR((int)unmapper.cap,
|
||||
unmapper.address + unmapper.pagePosition,
|
||||
unmapper.fd,
|
||||
unmapper, isSync);
|
||||
return Util.newMappedByteBufferR((int)unmapper.capacity(),
|
||||
unmapper.address(),
|
||||
unmapper.fileDescriptor(),
|
||||
unmapper, unmapper.isSync());
|
||||
} else {
|
||||
return Util.newMappedByteBuffer((int)unmapper.cap,
|
||||
unmapper.address + unmapper.pagePosition,
|
||||
unmapper.fd,
|
||||
unmapper, isSync);
|
||||
return Util.newMappedByteBuffer((int)unmapper.capacity(),
|
||||
unmapper.address(),
|
||||
unmapper.fileDescriptor(),
|
||||
unmapper, unmapper.isSync());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue