Closed udi-speedb closed 10 months ago
This method calculates the difference between 2 atomic variables:
bool ShouldInitiateAnotherFlushMemOnly(size_t curr_memory_used) const { return (curr_memory_used - memory_being_freed_ >= additional_flush_step_size_ / 2 && curr_memory_used >= additional_flush_initiation_size_); }
However, the code decreases curr_memory_used and then memory_beingfreed. Therefore it may happen that the difference will overflow (rather than being negative) and the method will return true rather than false.
true
false
This method calculates the difference between 2 atomic variables:
However, the code decreases curr_memory_used and then memory_beingfreed. Therefore it may happen that the difference will overflow (rather than being negative) and the method will return
true
rather thanfalse
.