projjal commented on a change in pull request #10465:
URL: https://github.com/apache/arrow/pull/10465#discussion_r668870317
##########
File path: cpp/src/gandiva/greedy_dual_size_cache.h
##########
@@ -101,12 +101,16 @@ class GreedyDualSizeCache {
if (size() >= capacity_) {
evict();
}
+ // check and handle possible overflow
+ if (UINT64_MAX - value.cost < inflation_) {
+ overflow();
Review comment:
You don't need to do it for every insert and get. You can do it inside
evict since only there inflation is updated
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]