| 592 | ~MemTrackerAllocator() {} |
| 593 | |
| 594 | pointer allocate(size_type n, const_pointer hint = 0) { |
| 595 | // Ideally we'd use TryConsume() here to enforce the tracker's limit. |
| 596 | // However, that means throwing bad_alloc if the limit is exceeded, and |
| 597 | // it's not clear that the rest of Kudu can handle that. |
| 598 | mem_tracker_->Consume(n * sizeof(T)); |
| 599 | return Alloc::allocate(n, hint); |
| 600 | } |
| 601 | |
| 602 | void deallocate(pointer p, size_type n) { |
| 603 | Alloc::deallocate(p, n); |