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

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

XMLWordPrintable

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

      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); }

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

              Created:
              Updated:
              Resolved: