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

ParallelCompactData::region_offset should not accept pointers outside the current region

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • gc
    • b16

    Description

      ```
      inline size_t
      ParallelCompactData::region_offset(const HeapWord* addr) const
      {
        assert(addr >= _region_start, "bad addr");
        assert(addr <= _region_end, "bad addr");
        return (size_t(addr) & RegionAddrOffsetMask) >> LogHeapWordSize;
      }
      ```
      `region_offset` calculates the distance (in words) from `_region_start` to `addr`. For `addr == _region_end`, it would mistakenly return 0. It's better to disallow such value as the argument, like `assert(addr < _region_end, "bad addr");`.

      Attachments

        Issue Links

          Activity

            People

              ayang Albert Yang
              ayang Albert Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: