< prev index next >


Print this page
@@ -47,10 +47,19 @@
    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);
+   HeapWord* allocate_with_old_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 +68,25 @@
    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);
    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();

@@ -92,8 +104,10 @@
    double internal_fragmentation();
    double external_fragmentation();
    void print_on(outputStream* out) const;
+   void reserve_regions(size_t to_reserve);
< prev index next >