src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp

Print this page

        

*** 370,379 **** --- 370,381 ---- DEBUG_ONLY( _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); ) } _dictionary->set_par_lock(&_parDictionaryAllocLock); + + _used_stable = 0; } // Like CompactibleSpace forward() but always calls cross_threshold() to // update the block offset table. Removed initialize_threshold call because // CFLS does not use a block offset array for contiguous spaces.
*** 575,584 **** --- 577,594 ---- size_t CompactibleFreeListSpace::used() const { return capacity() - free(); } + size_t CompactibleFreeListSpace::used_stable() const { + return _used_stable; + } + + void CompactibleFreeListSpace::recalculate_used_stable() { + _used_stable = used(); + } + size_t CompactibleFreeListSpace::free() const { // "MT-safe, but not MT-precise"(TM), if you will: i.e. // if you do this while the structures are in flux you // may get an approximate answer only; for instance // because there is concurrent allocation either
*** 1372,1381 **** --- 1382,1394 ---- _bt.verify_not_unallocated(res, size); // mangle a just allocated object with a distinct pattern. debug_only(fc->mangleAllocated(size)); } + // After allocation, recalculate used space and update used_stable + recalculate_used_stable(); + return res; } HeapWord* CompactibleFreeListSpace::allocate_adaptive_freelists(size_t size) { assert_lock_strong(freelistLock());