src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
changeset 59296 9186be5c78ba
parent 59290 97d13893ec3c
equal deleted inserted replaced
59295:8b6cc0bb93d0 59296:9186be5c78ba
     1 /*
     1 /*
     2  * Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
     2  * Copyright (c) 2016, 2019, Red Hat, Inc. All rights reserved.
     3  *
     3  *
     4  * This code is free software; you can redistribute it and/or modify it
     4  * This code is free software; you can redistribute it and/or modify it
     5  * under the terms of the GNU General Public License version 2 only, as
     5  * under the terms of the GNU General Public License version 2 only, as
     6  * published by the Free Software Foundation.
     6  * published by the Free Software Foundation.
     7  *
     7  *
   147 }
   147 }
   148 
   148 
   149 HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, ShenandoahAllocRequest& req, bool& in_new_region) {
   149 HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, ShenandoahAllocRequest& req, bool& in_new_region) {
   150   assert (!has_no_alloc_capacity(r), "Performance: should avoid full regions on this path: " SIZE_FORMAT, r->region_number());
   150   assert (!has_no_alloc_capacity(r), "Performance: should avoid full regions on this path: " SIZE_FORMAT, r->region_number());
   151 
   151 
       
   152   if (_heap->is_concurrent_root_in_progress() &&
       
   153       r->is_trash()) {
       
   154     return NULL;
       
   155   }
       
   156 
   152   try_recycle_trashed(r);
   157   try_recycle_trashed(r);
   153 
   158 
   154   in_new_region = r->is_empty();
   159   in_new_region = r->is_empty();
   155 
   160 
   156   HeapWord* result = NULL;
   161   HeapWord* result = NULL;