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

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u2Fixed 8Fixed hs22Fixed
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
12-09-2011

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

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

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

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.
16-05-2011

EVALUATION See Comments.
16-05-2011

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.
12-02-2009