--- old/src/share/vm/gc/g1/heapRegionManager.cpp 2016-09-19 12:11:35.806310066 +0200 +++ new/src/share/vm/gc/g1/heapRegionManager.cpp 2016-09-19 12:11:35.702310061 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -481,8 +481,9 @@ HeapRegionClaimer::HeapRegionClaimer(uint n_workers) : _n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) { assert(n_workers > 0, "Need at least one worker."); - _claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC); - memset(_claims, Unclaimed, sizeof(*_claims) * _n_regions); + uint* new_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC); + memset(new_claims, Unclaimed, sizeof(*_claims) * _n_regions); + _claims = new_claims; } HeapRegionClaimer::~HeapRegionClaimer() { --- old/src/share/vm/gc/g1/heapRegionManager.hpp 2016-09-19 12:11:36.566310099 +0200 +++ new/src/share/vm/gc/g1/heapRegionManager.hpp 2016-09-19 12:11:36.462310095 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -258,9 +258,9 @@ // The HeapRegionClaimer is used during parallel iteration over heap regions, // allowing workers to claim heap regions, gaining exclusive rights to these regions. class HeapRegionClaimer : public StackObj { - uint _n_workers; - uint _n_regions; - uint* _claims; + uint _n_workers; + uint _n_regions; + volatile uint* _claims; static const uint Unclaimed = 0; static const uint Claimed = 1; @@ -284,4 +284,3 @@ bool claim_region(uint region_index); }; #endif // SHARE_VM_GC_G1_HEAPREGIONMANAGER_HPP -