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

Remove explicit type casts from SerializeClosure::do_xxx() calls

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 21
    • None
    • hotspot
    • b23

    Description

      We have a few unsightly casts like this in the CDS code:

      void CppVtables::serialize(SerializeClosure* soc) {
        soc->do_ptr((void**)&_index);

      void StringTable::serialize_shared_table_header(SerializeClosure* soc) {
        ...
        soc->do_u4((u4*)(&_shared_strings_array_root_index));

      These type casts can be avoided by adding more member functions to SerializeClosure:

        void do_int(int* p);
        template <typename T> void do_ptr(T** p) { do_ptr((void**)p); }

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: