8321279: Implement hashCode() in Heap-X-Buffer.java.template

Reviewed-by: alanb, bpb
This commit is contained in:
Sergey Tsypanov 2023-12-13 09:10:11 +00:00 committed by Alan Bateman
parent 3d9d353edb
commit 8a0a6f8c25
2 changed files with 13 additions and 1 deletions

View file

@ -29,6 +29,7 @@ package java.nio;
import java.lang.foreign.MemorySegment;
import java.util.Objects;
import jdk.internal.util.ArraysSupport;
/**
#if[rw]
@ -705,6 +706,9 @@ class Heap$Type$Buffer$RW$
addr, segment)));
}
public int hashCode() {
return ArraysSupport.vectorizedHashCode(hb, ix(position()), remaining(), 1, ArraysSupport.T_BYTE);
}
#end[byte]
@ -733,6 +737,9 @@ class Heap$Type$Buffer$RW$
offset, segment);
}
public int hashCode() {
return ArraysSupport.vectorizedHashCode(hb, ix(position()), remaining(), 1, ArraysSupport.T_CHAR);
}
#end[char]