Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp @ 6010:720b6a76dd9d
7157073: G1: type change size_t -> uint for region counts / indexes
Summary: Change the type of fields / variables / etc. that represent region counts and indeces from size_t to uint.
Reviewed-by: iveresov, brutisso, jmasa, jwilhelm
author | tonyp |
---|---|
date | Wed, 18 Apr 2012 07:21:15 -0400 |
parents | b5290bf0a9e4 |
children | da91efe96a93 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Wed Apr 11 16:18:45 2012 +0200 +++ b/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Wed Apr 18 07:21:15 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -177,19 +177,19 @@ // values we read here are possible (i.e., at a STW phase at the end // of a GC). - size_t young_list_length = g1->young_list()->length(); - size_t survivor_list_length = g1->g1_policy()->recorded_survivor_regions(); + uint young_list_length = g1->young_list()->length(); + uint survivor_list_length = g1->g1_policy()->recorded_survivor_regions(); assert(young_list_length >= survivor_list_length, "invariant"); - size_t eden_list_length = young_list_length - survivor_list_length; + uint eden_list_length = young_list_length - survivor_list_length; // Max length includes any potential extensions to the young gen // we'll do when the GC locker is active. - size_t young_list_max_length = g1->g1_policy()->young_list_max_length(); + uint young_list_max_length = g1->g1_policy()->young_list_max_length(); assert(young_list_max_length >= survivor_list_length, "invariant"); - size_t eden_list_max_length = young_list_max_length - survivor_list_length; + uint eden_list_max_length = young_list_max_length - survivor_list_length; _overall_used = g1->used_unlocked(); - _eden_used = eden_list_length * HeapRegion::GrainBytes; - _survivor_used = survivor_list_length * HeapRegion::GrainBytes; + _eden_used = (size_t) eden_list_length * HeapRegion::GrainBytes; + _survivor_used = (size_t) survivor_list_length * HeapRegion::GrainBytes; _young_region_num = young_list_length; _old_used = subtract_up_to_zero(_overall_used, _eden_used + _survivor_used); @@ -207,7 +207,7 @@ committed -= _survivor_committed + _old_committed; // Next, calculate and remove the committed size for the eden. - _eden_committed = eden_list_max_length * HeapRegion::GrainBytes; + _eden_committed = (size_t) eden_list_max_length * HeapRegion::GrainBytes; // Somewhat defensive: be robust in case there are inaccuracies in // the calculations _eden_committed = MIN2(_eden_committed, committed); @@ -237,10 +237,10 @@ // When a new eden region is allocated, only the eden_used size is // affected (since we have recalculated everything else at the last GC). - size_t young_region_num = g1h()->young_list()->length(); + uint young_region_num = g1h()->young_list()->length(); if (young_region_num > _young_region_num) { - size_t diff = young_region_num - _young_region_num; - _eden_used += diff * HeapRegion::GrainBytes; + uint diff = young_region_num - _young_region_num; + _eden_used += (size_t) diff * HeapRegion::GrainBytes; // Somewhat defensive: cap the eden used size to make sure it // never exceeds the committed size. _eden_used = MIN2(_eden_used, _eden_committed);