yiguolei commented on code in PR #31122: URL: https://github.com/apache/doris/pull/31122#discussion_r1495274768
########## be/src/olap/lru_cache.cpp: ########## @@ -458,23 +461,28 @@ int64_t LRUCache::prune() { } } int64_t pruned_count = 0; + int64_t size = 0; while (to_remove_head != nullptr) { ++pruned_count; + size += to_remove_head->bytes; LRUHandle* next = to_remove_head->next; to_remove_head->free(); to_remove_head = next; } + if (freed_size) { + *freed_size = size; + } return pruned_count; } -int64_t LRUCache::prune_if(CacheValuePredicate pred, bool lazy_mode) { +int64_t LRUCache::prune_if(CachePrunePredicate pred, int64_t* freed_size, bool lazy_mode) { Review Comment: 一般把返回值放到参数列表的最后面 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org