mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8080775: Better argument formatting for assert() and friends
Reviewed-by: kbarrett, pliden
This commit is contained in:
parent
aa0818a98a
commit
1e71f67736
225 changed files with 1342 additions and 1432 deletions
|
@ -95,9 +95,9 @@ class GCCause : public AllStatic {
|
|||
// Causes for collection of the tenured gernation
|
||||
inline static bool is_tenured_allocation_failure_gc(GCCause::Cause cause) {
|
||||
assert(cause != GCCause::_old_generation_too_full_to_scavenge &&
|
||||
cause != GCCause::_old_generation_expanded_on_last_scavenge,
|
||||
err_msg("This GCCause may be correct but is not expected yet: %s",
|
||||
to_string(cause)));
|
||||
cause != GCCause::_old_generation_expanded_on_last_scavenge,
|
||||
"This GCCause may be correct but is not expected yet: %s",
|
||||
to_string(cause));
|
||||
// _tenured_generation_full or _cms_generation_full for full tenured generations
|
||||
// _adaptive_size_policy for a full collection after a young GC
|
||||
// _allocation_failure is the generic cause a collection which could result
|
||||
|
@ -141,14 +141,14 @@ class GCCauseString : StackObj {
|
|||
_position = jio_snprintf(_buffer, _length, "%s ", prefix);
|
||||
}
|
||||
assert(_position >= 0 && _position <= _length,
|
||||
err_msg("Need to increase the buffer size in GCCauseString? %d", _position));
|
||||
"Need to increase the buffer size in GCCauseString? %d", _position);
|
||||
}
|
||||
|
||||
GCCauseString& append(const char* str) {
|
||||
int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str);
|
||||
_position += res;
|
||||
assert(res >= 0 && _position <= _length,
|
||||
err_msg("Need to increase the buffer size in GCCauseString? %d", res));
|
||||
"Need to increase the buffer size in GCCauseString? %d", res);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue