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

Sergey Tsypanov stsypanov at openjdk.org
Wed Dec 6 13:37:55 UTC 2023


Currently in `Heap*Buffer.hashCode()` is inherited from `*Buffer`, implemented as 

public int hashCode() {
    int h = 1;
    int p = position();
    for (int i = limit() - 1; i >= p; i--)
        h = 31 * h + (int)get(i);
    return h;
}

This can be improved using `ArraysSupport.vectorizedHashCode()`

-------------

Commit messages:
 - 8321279: Fix build
 - 8321279: Fix build
 - 8321279: Fix build
 - 8321279: Implement hashCode() in Heap-X-Buffer.java.template
 - 8321279: Implement hashCode() in Heap-X-Buffer.java.template

Changes: https://git.openjdk.org/jdk/pull/16992/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16992&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321279
  Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/16992.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16992/head:pull/16992

PR: https://git.openjdk.org/jdk/pull/16992


More information about the nio-dev mailing list