113 // length of the sequence found. If this result is zero, no such sequence could be found,
114 // otherwise res_idx indicates the start index of these regions.
115 uint find_unavailable_from_idx(uint start_idx, uint* res_idx) const;
116 // Finds the next sequence of empty regions starting from start_idx, going backwards in
117 // the heap. Returns the length of the sequence found. If this value is zero, no
118 // sequence could be found, otherwise res_idx contains the start index of this range.
119 uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
120 // Allocate a new HeapRegion for the given index.
121 HeapRegion* new_heap_region(uint hrm_index);
122 #ifdef ASSERT
123 public:
124 bool is_free(HeapRegion* hr) const;
125 #endif
126 // Returns whether the given region is available for allocation.
127 bool is_available(uint region) const;
128
129 public:
130 // Empty constructor, we'll initialize it with the initialize() method.
131 HeapRegionManager() : _regions(), _heap_mapper(NULL), _num_committed(0),
132 _next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL),
133 _allocated_heapregions_length(0), _available_map(),
134 _free_list("Free list", new MasterFreeRegionListMtSafeChecker())
135 { }
136
137 void initialize(G1RegionToSpaceMapper* heap_storage,
138 G1RegionToSpaceMapper* prev_bitmap,
139 G1RegionToSpaceMapper* next_bitmap,
140 G1RegionToSpaceMapper* bot,
141 G1RegionToSpaceMapper* cardtable,
142 G1RegionToSpaceMapper* card_counts);
143
144 // Return the "dummy" region used for G1AllocRegion. This is currently a hardwired
145 // new HeapRegion that owns HeapRegion at index 0. Since at the moment we commit
146 // the heap from the lowest address, this region (and its associated data
147 // structures) are available and we do not need to check further.
148 HeapRegion* get_dummy_region() { return new_heap_region(0); }
149
150 // Return the HeapRegion at the given index. Assume that the index
151 // is valid.
152 inline HeapRegion* at(uint index) const;
153
|
113 // length of the sequence found. If this result is zero, no such sequence could be found,
114 // otherwise res_idx indicates the start index of these regions.
115 uint find_unavailable_from_idx(uint start_idx, uint* res_idx) const;
116 // Finds the next sequence of empty regions starting from start_idx, going backwards in
117 // the heap. Returns the length of the sequence found. If this value is zero, no
118 // sequence could be found, otherwise res_idx contains the start index of this range.
119 uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
120 // Allocate a new HeapRegion for the given index.
121 HeapRegion* new_heap_region(uint hrm_index);
122 #ifdef ASSERT
123 public:
124 bool is_free(HeapRegion* hr) const;
125 #endif
126 // Returns whether the given region is available for allocation.
127 bool is_available(uint region) const;
128
129 public:
130 // Empty constructor, we'll initialize it with the initialize() method.
131 HeapRegionManager() : _regions(), _heap_mapper(NULL), _num_committed(0),
132 _next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL),
133 _allocated_heapregions_length(0), _available_map(mtGC),
134 _free_list("Free list", new MasterFreeRegionListMtSafeChecker())
135 { }
136
137 void initialize(G1RegionToSpaceMapper* heap_storage,
138 G1RegionToSpaceMapper* prev_bitmap,
139 G1RegionToSpaceMapper* next_bitmap,
140 G1RegionToSpaceMapper* bot,
141 G1RegionToSpaceMapper* cardtable,
142 G1RegionToSpaceMapper* card_counts);
143
144 // Return the "dummy" region used for G1AllocRegion. This is currently a hardwired
145 // new HeapRegion that owns HeapRegion at index 0. Since at the moment we commit
146 // the heap from the lowest address, this region (and its associated data
147 // structures) are available and we do not need to check further.
148 HeapRegion* get_dummy_region() { return new_heap_region(0); }
149
150 // Return the HeapRegion at the given index. Assume that the index
151 // is valid.
152 inline HeapRegion* at(uint index) const;
153
|