Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/15050
Change subject: IMPALA-9291: MemTracker's TryConsume() should behave consistent with Consume()/Release() ...................................................................... IMPALA-9291: MemTracker's TryConsume() should behave consistent with Consume()/Release() Before this fix MemTracker::Consume() and Release() could take negative numbers as arguments. In that case Consume(-val) would invoke Release(val) and vice versa. On the other hand, TryConsume() was a no-op for negative values and returned success. This could lead to errors in the following case: TryConsume(-42); // no-op ... Release(-42); // -> Consume(42); And in the end the mem tracker would think there is 42 bytes of unallocated memory. This commit changes mem-tracker to forbid negative values. Testing: * ran exhaustive tests Change-Id: I22e613c49e4a6bd218e7f7f7c0d6bec95b75cff5 --- M be/src/runtime/mem-tracker-test.cc M be/src/runtime/mem-tracker.h 2 files changed, 30 insertions(+), 24 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/50/15050/1 -- To view, visit http://gerrit.cloudera.org:8080/15050 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I22e613c49e4a6bd218e7f7f7c0d6bec95b75cff5 Gerrit-Change-Number: 15050 Gerrit-PatchSet: 1 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
