comparison src/share/vm/gc_implementation/shared/allocationStats.hpp @ 17937:78bbf4d43a14

8037816: Fix for 8036122 breaks build with Xcode5/clang 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas 8043164: Format warning in traceStream.hpp Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings Reviewed-by: kvn, coleenp, iveresov, twisti
author drchase
date Thu, 22 May 2014 15:52:41 -0400
parents de88570fabfc
children 52b4284cb496
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
1 /* 1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
105 ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births() 105 ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births()
106 - split_deaths() - coal_deaths(); 106 - split_deaths() - coal_deaths();
107 assert(demand >= 0, 107 assert(demand >= 0,
108 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for " 108 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
109 PTR_FORMAT " (size=" SIZE_FORMAT ")", 109 PTR_FORMAT " (size=" SIZE_FORMAT ")",
110 demand, this, count)); 110 demand, p2i(this), count));
111 // Defensive: adjust for imprecision in event counting 111 // Defensive: adjust for imprecision in event counting
112 if (demand < 0) { 112 if (demand < 0) {
113 demand = 0; 113 demand = 0;
114 } 114 }
115 float old_rate = _demand_rate_estimate.padded_average(); 115 float old_rate = _demand_rate_estimate.padded_average();
118 float new_rate = _demand_rate_estimate.padded_average(); 118 float new_rate = _demand_rate_estimate.padded_average();
119 ssize_t old_desired = _desired; 119 ssize_t old_desired = _desired;
120 float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); 120 float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
121 _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); 121 _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
122 if (PrintFLSStatistics > 1) { 122 if (PrintFLSStatistics > 1) {
123 gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d", 123 gclog_or_tty->print_cr(
124 demand, old_rate, rate, new_rate, old_desired, _desired); 124 "demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
125 demand, old_rate, rate, new_rate, old_desired, _desired);
125 } 126 }
126 } 127 }
127 } 128 }
128 129
129 ssize_t desired() const { return _desired; } 130 ssize_t desired() const { return _desired; }