< prev index next >

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

Print this page
*** 47,10 ***
--- 47,18 ---
  
    bool is_mutator_free(size_t idx) const;
    bool is_collector_free(size_t idx) const;
  
    HeapWord* try_allocate_in(ShenandoahHeapRegion* region, ShenandoahAllocRequest& req, bool& in_new_region);
+   HeapWord* allocate_with_affiliation(ShenandoahRegionAffiliation affiliation, ShenandoahAllocRequest& req, bool& in_new_region);
+ 
+   // While holding the heap lock, allocate memory for a single object which is to be entirely contained
+   // within a single HeapRegion as characterized by req.  The req.size() value is known to be less than or
+   // equal to ShenandoahHeapRegion::humongous_threshold_words().  The caller of allocate_single is responsible
+   // for registering the resulting object and setting the remembered set card values as appropriate.  The
+   // most common case is that we are allocating a PLAB in which case object registering and card dirtying
+   // is managed after the PLAB is divided into individual objects.
    HeapWord* allocate_single(ShenandoahAllocRequest& req, bool& in_new_region);
    HeapWord* allocate_contiguous(ShenandoahAllocRequest& req);
  
    void flip_to_gc(ShenandoahHeapRegion* r);
  

*** 59,22 ***
    bool touches_bounds(size_t num) const;
  
    void increase_used(size_t amount);
    void clear_internal();
  
-   size_t collector_count() const { return _collector_free_bitmap.count_one_bits(); }
-   size_t mutator_count()   const { return _mutator_free_bitmap.count_one_bits();   }
- 
    void try_recycle_trashed(ShenandoahHeapRegion *r);
  
    bool can_allocate_from(ShenandoahHeapRegion *r);
    size_t alloc_capacity(ShenandoahHeapRegion *r);
    bool has_no_alloc_capacity(ShenandoahHeapRegion *r);
  
  public:
    ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions);
  
    void clear();
    void rebuild();
  
    void recycle_trash();
  
--- 67,25 ---
    bool touches_bounds(size_t num) const;
  
    void increase_used(size_t amount);
    void clear_internal();
  
    void try_recycle_trashed(ShenandoahHeapRegion *r);
  
    bool can_allocate_from(ShenandoahHeapRegion *r);
    size_t alloc_capacity(ShenandoahHeapRegion *r);
    bool has_no_alloc_capacity(ShenandoahHeapRegion *r);
  
  public:
    ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions);
  
+   // Number of regions dedicated to GC allocations (for evacuation or promotion) that are currently free
+   size_t collector_count() const { return _collector_free_bitmap.count_one_bits(); }
+ 
+   // Number of regions dedicated to mutator allocations that are currently free
+   size_t mutator_count()   const { return _mutator_free_bitmap.count_one_bits();   }
+ 
    void clear();
    void rebuild();
  
    void recycle_trash();
  
< prev index next >