remove unused function

This commit is contained in:
Awni Hannun 2023-12-25 16:39:26 -08:00
parent f3c7a7c1e5
commit 58f3c15963
2 changed files with 0 additions and 19 deletions

View File

@ -81,24 +81,6 @@ void BufferCache::recycle_to_cache(MTL::Buffer* buf) {
}
}
void BufferCache::release_cached_buffers(size_t min_bytes_to_free) {
if (min_bytes_to_free >= 0.9 * pool_size_) {
clear();
} else {
std::lock_guard<std::mutex> lk(cache_mutex_);
size_t total_bytes_freed = 0;
while (tail_ && (total_bytes_freed < min_bytes_to_free)) {
if (tail_->buf) {
total_bytes_freed += tail_->buf->length();
tail_->buf->release();
tail_->buf = nullptr;
}
remove_from_list(tail_);
}
pool_size_ -= total_bytes_freed;
}
}
void BufferCache::add_at_head(BufferCache::BufferHolder* to_add) {
if (!to_add)
return;

View File

@ -23,7 +23,6 @@ class BufferCache {
MTL::Buffer* reuse_from_cache(size_t size);
void recycle_to_cache(MTL::Buffer* buf);
void release_cached_buffers(size_t min_bytes_to_free);
private:
struct BufferHolder {