MCPcopy Create free account
hub / github.com/cpputest/cpputest / checkForCorruption

Method checkForCorruption

src/CppUTest/MemoryLeakDetector.cpp:612–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612void MemoryLeakDetector::checkForCorruption(MemoryLeakDetectorNode* node, const char* file, size_t line, TestMemoryAllocator* allocator, bool allocateNodesSeperately)
613{
614 if (!matchingAllocation(node->allocator_->actualAllocator(), allocator->actualAllocator()))
615 outputBuffer_.reportAllocationDeallocationMismatchFailure(node, file, line, allocator->actualAllocator(), reporter_);
616 else if (!validMemoryCorruptionInformation(node->memory_ + node->size_))
617 outputBuffer_.reportMemoryCorruptionFailure(node, file, line, allocator->actualAllocator(), reporter_);
618 else if (allocateNodesSeperately)
619 allocator->freeMemoryLeakNode((char*) node);
620}
621
622char* MemoryLeakDetector::allocMemory(TestMemoryAllocator* allocator, size_t size, bool allocatNodesSeperately)
623{

Callers

nothing calls this directly

Tested by

no test coverage detected