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

Fix conversion warning after 8067341

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • hotspot
    • gc
    • b85

        Change "8067341: Modify PLAB sizing algorithm to waste less" introduced the following code:

        size_t const cur_plab_sz = (double)total_waste_allowed / G1LastPLABAverageOccupancy;

        which triggers a conversion warning with older versions of GCC and potentially other compilers as well:

        hotspot-rt/src/share/vm/gc/g1/g1EvacStats.cpp: In member function 'virtual void G1EvacStats::adjust_desired_plab_sz()':
        hotspot-rt/src/share/vm/gc/g1/g1EvacStats.cpp:96: warning: converting to 'size_t' from 'double'
        make[4]: *** [g1EvacStats.o] Error 1

        The warning can be easily fixed as follows:

        size_t const cur_plab_sz = (sizte_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy);

              simonis Volker Simonis
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: