int MemoryLeakDetectorList::getTotalLeaks(MemLeakPeriod period) { int total_leaks = 0; for (MemoryLeakDetectorNode* node = head_; node; node = node->next_) { if (isInPeriod(node, period)) total_leaks++; } return total_leaks; }
void MemoryLeakDetectorList::clearAllAccounting(MemLeakPeriod period) { MemoryLeakDetectorNode* cur = head_; MemoryLeakDetectorNode* prev = 0; while (cur) { if (isInPeriod(cur, period)) { if (prev) { prev->next_ = cur->next_; cur = prev; } else { head_ = cur->next_; cur = head_; continue; } } prev = cur; cur = cur->next_; } }
MemoryLeakDetectorNode* MemoryLeakDetectorList::getLeakFrom(MemoryLeakDetectorNode* node, MemLeakPeriod period) { for (MemoryLeakDetectorNode* cur = node; cur; cur = cur->next_) if (isInPeriod(cur, period)) return cur; return 0; }
bool MemoryLeakDetectorList::hasLeaks(MemLeakPeriod period) { for (MemoryLeakDetectorNode* node = head_; node; node = node->next_) if (isInPeriod(node, period)) return true; return false; }