United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6804436 G1: heap region indices should be size_t
JDK-6804436 : G1: heap region indices should be size_t

Details
Type:
Enhancement
Submit Date:
2009-02-11
Status:
Closed
Updated Date:
2011-11-25
Project Name:
JDK
Resolved Date:
2011-09-30
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
hs14
Fixed Versions:
hs22 (b02)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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
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
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
EVALUATION

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

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

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

See main CR
                                     
2011-09-12



Hardware and Software, Engineered to Work Together