Avoid using 32-bit counters in CDS code

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 18
    • Component/s: hotspot
    • master

      For example:

      in src/hotspot/share/cds/metaspaceShared.cpp:
      class CountSharedSymbols : public SymbolClosure {
       private:
         int _count;

      src/hotspot/share/classfile/symbolTable.cpp:
         return CompactHashtableWriter::estimate_size(int(_items_cont));
          ....
         CompactHashtableWriter writer(int(_items_count), ArchiveBuilder::symbol_stats());

      For clarity, it's better to use size_t for these counters (even if we know that there will be fewer than 0x7fffffff symbols due to ArchiveBuilder::MAX_SHARED_DELTA).

            Assignee:
            Matias Saavedra Silva
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: