src/share/vm/memory/threadLocalAllocBuffer.hpp

changeset 6376
cfd4aac53239
parent 4153
b9a9ed0f8eeb
child 6876
710a3c8b516e
child 7470
060cdf93040c
     1.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.hpp	Thu Jan 23 12:08:28 2014 +0100
     1.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp	Mon Jan 27 13:14:53 2014 +0100
     1.3 @@ -45,7 +45,9 @@
     1.4    HeapWord* _end;                                // allocation end (excluding alignment_reserve)
     1.5    size_t    _desired_size;                       // desired size   (including alignment_reserve)
     1.6    size_t    _refill_waste_limit;                 // hold onto tlab if free() is larger than this
     1.7 +  size_t    _allocated_before_last_gc;           // total bytes allocated up until the last gc
     1.8  
     1.9 +  static size_t   _max_size;                     // maximum size of any TLAB
    1.10    static unsigned _target_refills;               // expected number of refills between GCs
    1.11  
    1.12    unsigned  _number_of_refills;
    1.13 @@ -99,12 +101,13 @@
    1.14    static GlobalTLABStats* global_stats() { return _global_stats; }
    1.15  
    1.16  public:
    1.17 -  ThreadLocalAllocBuffer() : _allocation_fraction(TLABAllocationWeight) {
    1.18 +  ThreadLocalAllocBuffer() : _allocation_fraction(TLABAllocationWeight), _allocated_before_last_gc(0) {
    1.19      // do nothing.  tlabs must be inited by initialize() calls
    1.20    }
    1.21  
    1.22    static const size_t min_size()                 { return align_object_size(MinTLABSize / HeapWordSize); }
    1.23 -  static const size_t max_size();
    1.24 +  static const size_t max_size()                 { assert(_max_size != 0, "max_size not set up"); return _max_size; }
    1.25 +  static void set_max_size(size_t max_size)      { _max_size = max_size; }
    1.26  
    1.27    HeapWord* start() const                        { return _start; }
    1.28    HeapWord* end() const                          { return _end; }

mercurial