JDK-6804436 : G1: heap region indices should be size_t
  • Type: Enhancement
  • Status: Closed
  • Resolution: Fixed
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P5
  • Affected Version: hs14
  • OS: generic
  • CPU: generic
  • Submit Date: 2009-02-11
  • Updated Date: 2013-09-18
  • Resolved Date: 2011-09-30
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u2Fixed 8Resolved
Related Reports
Relates :  
Relates :  
Description
Some g1 code uses int variables as region indices; they should use size_t instead.  A few examples from heapRegionSeq.hpp:

int _alloc_search_start;
HeapWord* alloc_obj_from_region_index(int ind, size_t word_size);
int _next_rr_candidate;
int find(HeapRegion* hr);
void iterate_from(int idx, HeapRegionClosure* blk);

Comments
EVALUATION See main CR
2011-09-12

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/c3f1170908be
2011-07-08

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/c3f1170908be
2011-07-08

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/c3f1170908be
2011-06-10

PUBLIC COMMENTS Some of this work will be done as part of 7045330 (the HeapRegionSeq part). We'll do the rest (the HeapRegion part) separately as part of this CR.
2011-05-16

EVALUATION See Comments.
2011-05-16

PUBLIC COMMENTS We do use an int, instead of size_t, for region indeces given that there is an assumption that -1 indicates "no region". We could change this assumption so that MAX_SIZE (or the equivalent) indicates "no region". That's a pretty big change though.
2009-02-12