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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: 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); }

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

              Created:
              Updated:
              Resolved: