< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp

Print this page




  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  27 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  28 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  29 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  30 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  31 #include "logging/logStream.hpp"

  32 
  33 ShenandoahFreeSet::ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions) :
  34   _heap(heap),
  35   _mutator_free_bitmap(max_regions, mtGC),
  36   _collector_free_bitmap(max_regions, mtGC),
  37   _max(max_regions)
  38 {
  39   clear_internal();
  40 }
  41 
  42 void ShenandoahFreeSet::increase_used(size_t num_bytes) {
  43   assert_heaplock_owned_by_current_thread();
  44   _used += num_bytes;
  45 
  46   assert(_used <= _capacity, "must not use more than we have: used: " SIZE_FORMAT
  47          ", capacity: " SIZE_FORMAT ", num_bytes: " SIZE_FORMAT, _used, _capacity, num_bytes);
  48 }
  49 
  50 bool ShenandoahFreeSet::is_mutator_free(size_t idx) const {
  51   assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT " (left: " SIZE_FORMAT ", right: " SIZE_FORMAT ")",




  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  27 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  28 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  29 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  30 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  31 #include "logging/logStream.hpp"
  32 #include "runtime/orderAccess.hpp"
  33 
  34 ShenandoahFreeSet::ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions) :
  35   _heap(heap),
  36   _mutator_free_bitmap(max_regions, mtGC),
  37   _collector_free_bitmap(max_regions, mtGC),
  38   _max(max_regions)
  39 {
  40   clear_internal();
  41 }
  42 
  43 void ShenandoahFreeSet::increase_used(size_t num_bytes) {
  44   assert_heaplock_owned_by_current_thread();
  45   _used += num_bytes;
  46 
  47   assert(_used <= _capacity, "must not use more than we have: used: " SIZE_FORMAT
  48          ", capacity: " SIZE_FORMAT ", num_bytes: " SIZE_FORMAT, _used, _capacity, num_bytes);
  49 }
  50 
  51 bool ShenandoahFreeSet::is_mutator_free(size_t idx) const {
  52   assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT " (left: " SIZE_FORMAT ", right: " SIZE_FORMAT ")",


< prev index next >