mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8321279: Implement hashCode() in Heap-X-Buffer.java.template
Reviewed-by: alanb, bpb
This commit is contained in:
parent
3d9d353edb
commit
8a0a6f8c25
2 changed files with 13 additions and 1 deletions
|
@ -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]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue