| 41 | } |
| 42 | |
| 43 | void ReservationTracker::InitRootTracker( |
| 44 | RuntimeProfile* profile, int64_t reservation_limit) { |
| 45 | lock_guard<SpinLock> l(lock_); |
| 46 | DCHECK(!initialized_); |
| 47 | parent_ = nullptr; |
| 48 | mem_tracker_ = nullptr; |
| 49 | reservation_limit_.Store(reservation_limit); |
| 50 | reservation_.Store(0); |
| 51 | used_reservation_.Store(0); |
| 52 | child_reservations_.Store(0); |
| 53 | initialized_ = true; |
| 54 | |
| 55 | InitCounters(profile, reservation_limit); |
| 56 | COUNTER_SET(counters_.peak_reservation, 0); |
| 57 | |
| 58 | CheckConsistency(); |
| 59 | } |
| 60 | |
| 61 | void ReservationTracker::InitChildTracker(RuntimeProfile* profile, |
| 62 | ReservationTracker* parent, MemTracker* mem_tracker, int64_t reservation_limit, |