< prev index next >

src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp

Print this page

12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 
27 #include "gc/g1/g1CollectedHeap.hpp"
28 #include "gc/g1/g1EvacFailureRegions.inline.hpp"
29 #include "gc/g1/heapRegion.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/atomic.hpp"

32 
33 G1EvacFailureRegions::G1EvacFailureRegions() :
34   _regions_failed_evacuation(mtGC),
35   _evac_failure_regions(nullptr),
36   _evac_failure_regions_cur_length(0),
37   _max_regions(0) { }
38 
39 G1EvacFailureRegions::~G1EvacFailureRegions() {
40   assert(_evac_failure_regions == nullptr, "not cleaned up");
41 }
42 
43 void G1EvacFailureRegions::pre_collection(uint max_regions) {
44   Atomic::store(&_evac_failure_regions_cur_length, 0u);
45   _max_regions = max_regions;
46   _regions_failed_evacuation.resize(_max_regions);
47   _evac_failure_regions = NEW_C_HEAP_ARRAY(uint, _max_regions, mtGC);
48 }
49 
50 void G1EvacFailureRegions::post_collection() {
51   _regions_failed_evacuation.resize(0);

12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 
27 #include "gc/g1/g1CollectedHeap.hpp"
28 #include "gc/g1/g1EvacFailureRegions.inline.hpp"
29 #include "gc/g1/heapRegion.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/atomic.hpp"
32 #include "utilities/bitMap.inline.hpp"
33 
34 G1EvacFailureRegions::G1EvacFailureRegions() :
35   _regions_failed_evacuation(mtGC),
36   _evac_failure_regions(nullptr),
37   _evac_failure_regions_cur_length(0),
38   _max_regions(0) { }
39 
40 G1EvacFailureRegions::~G1EvacFailureRegions() {
41   assert(_evac_failure_regions == nullptr, "not cleaned up");
42 }
43 
44 void G1EvacFailureRegions::pre_collection(uint max_regions) {
45   Atomic::store(&_evac_failure_regions_cur_length, 0u);
46   _max_regions = max_regions;
47   _regions_failed_evacuation.resize(_max_regions);
48   _evac_failure_regions = NEW_C_HEAP_ARRAY(uint, _max_regions, mtGC);
49 }
50 
51 void G1EvacFailureRegions::post_collection() {
52   _regions_failed_evacuation.resize(0);
< prev index next >