2955 } |
2955 } |
2956 cur = next; |
2956 cur = next; |
2957 } |
2957 } |
2958 } |
2958 } |
2959 |
2959 |
2960 CompactibleSpace* G1CollectedHeap::first_compactible_space() { |
2960 HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { |
2961 return n_regions() > 0 ? region_at(0) : NULL; |
2961 // We're not using an iterator given that it will wrap around when |
2962 } |
2962 // it reaches the last region and this is not what we want here. |
2963 |
2963 for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { |
|
2964 HeapRegion* hr = region_at(index); |
|
2965 if (!hr->isHumongous()) { |
|
2966 return hr; |
|
2967 } |
|
2968 } |
|
2969 return NULL; |
|
2970 } |
2964 |
2971 |
2965 Space* G1CollectedHeap::space_containing(const void* addr) const { |
2972 Space* G1CollectedHeap::space_containing(const void* addr) const { |
2966 Space* res = heap_region_containing(addr); |
2973 Space* res = heap_region_containing(addr); |
2967 return res; |
2974 return res; |
2968 } |
2975 } |