mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8288534: Out of bound errors for memory segment access mentions wrong values
Reviewed-by: psandoz
This commit is contained in:
parent
729164f534
commit
ff3db52044
3 changed files with 26 additions and 3 deletions
|
@ -28,6 +28,7 @@ package java.lang.foreign;
|
|||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import jdk.internal.foreign.Utils;
|
||||
import jdk.internal.vm.annotation.ForceInline;
|
||||
import jdk.internal.vm.annotation.Stable;
|
||||
|
||||
abstract non-sealed class AbstractLayout implements MemoryLayout {
|
||||
|
@ -86,6 +87,7 @@ abstract non-sealed class AbstractLayout implements MemoryLayout {
|
|||
}
|
||||
|
||||
@Override
|
||||
@ForceInline
|
||||
public long byteSize() {
|
||||
if (cachedSize == 0) {
|
||||
cachedSize = Utils.bitsToBytesOrThrow(bitSize(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue