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

G1: Call offset_of directly in subclasses of G1CardSetContainer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • hotspot
    • gc
    • b23

      Instead of

      ```
      class G1CardSetArray : public G1CardSetContainer {

        template<typename Derived>
        static size_t header_size_in_bytes_internal() {
          return offset_of(Derived, _data);
        }
        
        ...
        
        static size_t header_size_in_bytes() { return header_size_in_bytes_internal<G1CardSetArray>(); }

      }
      ```

      one can call `offset_of` directly on calculating the header size. The same pattern exists in other subclasses.

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

              Created:
              Updated:
              Resolved: