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

Method deallocMemory

src/CppUTest/MemoryLeakDetector.cpp:671–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671void MemoryLeakDetector::deallocMemory(TestMemoryAllocator* allocator, void* memory, const char* file, size_t line, bool allocatNodesSeperately)
672{
673 if (memory == NULLPTR) return;
674
675 MemoryLeakDetectorNode* node = memoryTable_.removeNode((char*) memory);
676 if (node == NULLPTR) {
677 outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_);
678 return;
679 }
680#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK
681 allocatNodesSeperately = true;
682#endif
683 if (!allocator->hasBeenDestroyed()) {
684 size_t size = node->size_;
685 checkForCorruption(node, file, line, allocator, allocatNodesSeperately);
686 allocator->free_memory((char*) memory, size, file, line);
687 }
688}
689
690void MemoryLeakDetector::deallocMemory(TestMemoryAllocator* allocator, void* memory, bool allocatNodesSeperately)
691{

Callers 11

threadsafe_mem_leak_freeFunction · 0.80
mem_leak_freeFunction · 0.80
mem_leak_operator_deleteFunction · 0.80
free_memoryMethod · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
free_memoryMethod · 0.80
teardownFunction · 0.80

Calls 4

removeNodeMethod · 0.80
hasBeenDestroyedMethod · 0.80
free_memoryMethod · 0.45

Tested by 5

free_memoryMethod · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
free_memoryMethod · 0.64
teardownFunction · 0.64