예제 #1
0
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;
}
예제 #2
0
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_;
    }
}
예제 #3
0
MemoryLeakDetectorNode* MemoryLeakDetectorList::getLeakFrom(MemoryLeakDetectorNode* node, MemLeakPeriod period)
{
    for (MemoryLeakDetectorNode* cur = node; cur; cur = cur->next_)
        if (isInPeriod(cur, period)) return cur;
    return 0;
}
예제 #4
0
bool MemoryLeakDetectorList::hasLeaks(MemLeakPeriod period)
{
	for (MemoryLeakDetectorNode* node = head_; node; node = node->next_)
		if (isInPeriod(node, period)) return true;
	return false;
}