This commit is contained in:
Jesper Wilhelmsson 2022-06-17 13:46:47 +00:00
commit af64d316c0
14 changed files with 47 additions and 25 deletions

View file

@ -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(),