Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294432

Add provisions to calculate hash values from MemorySegments

XMLWordPrintable

      It is expected that many classes will use MemorySegments to back internal states. MemorySegment already has a method `long
      mismatch(MemorySegment other)` that can be used to determine content equality for MemorySegments and thus provides a useful feature when implementing `Object:equals` methods.

      It is hereby proposed to introduce a new JDK-internal method `int contentHash(MemorySegment segment, long from, long to)` that computes a hash value for the provided range.

      An opportunity is to use vectorized operations to improve performance.

            pminborg Per-Ake Minborg
            pminborg Per-Ake Minborg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: