8286387: Remove unused FreeListAllocator::reduce_free_list

Reviewed-by: kbarrett, tschatzl
This commit is contained in:
Albert Mingkun Yang 2022-05-11 15:06:14 +00:00
parent ae695d6cb7
commit 89de756ffb
5 changed files with 0 additions and 38 deletions

View File

@ -195,19 +195,3 @@ bool FreeListAllocator::try_transfer_pending() {
Atomic::release_store(&_transfer_lock, false);
return true;
}
size_t FreeListAllocator::reduce_free_list(size_t remove_goal) {
try_transfer_pending();
size_t removed = 0;
for ( ; removed < remove_goal; ++removed) {
FreeNode* node = _free_list.pop();
if (node == nullptr) break;
node->~FreeNode();
_config->deallocate(node);
}
size_t new_count = Atomic::sub(&_free_count, removed);
log_debug(gc, freelist)
("Reduced %s free list by " SIZE_FORMAT " to " SIZE_FORMAT,
name(), removed, new_count);
return removed;
}

View File

@ -150,12 +150,6 @@ public:
size_t mem_size() const {
return sizeof(*this);
}
// Deallocate some of the available nodes in the free_list.
// remove_goal is the target number to remove. Returns the number
// actually deallocated, which may be less than the goal if there
// were fewer available.
size_t reduce_free_list(size_t remove_goal);
};
#endif // SHARE_GC_SHARED_FREELISTALLOCATOR_HPP

View File

@ -72,10 +72,6 @@ void BufferNode::Allocator::release(BufferNode* node) {
_free_list.release(node);
}
size_t BufferNode::Allocator::reduce_free_list(size_t remove_goal) {
return _free_list.reduce_free_list(remove_goal);
}
PtrQueueSet::PtrQueueSet(BufferNode::Allocator* allocator) :
_allocator(allocator)
{}

View File

@ -198,11 +198,6 @@ public:
// If _free_list has items buffered in the pending list, transfer
// these to make them available for re-allocation.
bool flush_free_list() { return _free_list.try_transfer_pending(); }
// Deallocate some of the available buffers. remove_goal is the target
// number to remove. Returns the number actually deallocated, which may
// be less than the goal if there were fewer available.
size_t reduce_free_list(size_t remove_goal);
};
// A PtrQueueSet represents resources common to a set of pointer queues.

View File

@ -85,13 +85,6 @@ TEST_VM(PtrQueueBufferAllocatorTest, test) {
}
ASSERT_TRUE(BufferNode::TestSupport::try_transfer_pending(&allocator));
ASSERT_EQ(node_count, allocator.free_count());
// Destroy some nodes in the free list.
// We don't have a way to verify destruction, but we can at
// least verify we don't crash along the way.
size_t count = allocator.free_count();
ASSERT_EQ(count, allocator.reduce_free_list(count));
// destroy allocator.
}
// Stress test with lock-free allocator and completed buffer list.