aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/allocation_tracker.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/allocation_tracker.h')
-rw-r--r--tensorflow/compiler/xla/service/allocation_tracker.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/allocation_tracker.h b/tensorflow/compiler/xla/service/allocation_tracker.h
index e007680016..ebbf35b6fe 100644
--- a/tensorflow/compiler/xla/service/allocation_tracker.h
+++ b/tensorflow/compiler/xla/service/allocation_tracker.h
@@ -63,10 +63,10 @@ class Allocation {
CHECK_GE(ref_count_, 0);
return ref_count_;
}
- void increment_ref_count() {
+ void increment_ref_count(int inc) {
CHECK_GT(ref_count_, 0);
- CHECK_LT(ref_count_, INT_MAX);
- ++ref_count_;
+ CHECK_LE(ref_count_, INT_MAX - inc);
+ ref_count_ += inc;
}
void decrement_ref_count() {
CHECK_GT(ref_count_, 0);