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

Simplify clean up of ArchiveBuilder::SourceObjInfo

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 21
    • 21
    • hotspot

      The clean up of SourceObjInfo requires iterating over each entry in a hashtable to its _ref member:

      https://github.com/openjdk/jdk/blob/6475501a01268f5c35a9bf30f4104ce7a40d8181/src/hotspot/share/cds/archiveBuilder.hpp#L207-L213

      class SrcObjTableCleaner {
      public:
        bool do_entry(address key, const SourceObjInfo& value) {
          delete value.ref();
          return true;
        }
      };

      void ArchiveBuilder::clean_up_src_obj_table() {
        SrcObjTableCleaner cleaner;
        _src_obj_table.iterate(&cleaner);
      }

      This can be simplified by moving the "delete value.ref()" into the destructor of SourceObjInfo.

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

              Created:
              Updated:
              Resolved: