JDK-8135179 : Fix conversion warning after 8067341
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-09-08
  • Updated: 2015-11-09
  • Resolved: 2015-09-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b85Fixed
Related Reports
Relates :  
Description
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);