| 669 | } |
| 670 | |
| 671 | void 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 | |
| 690 | void MemoryLeakDetector::deallocMemory(TestMemoryAllocator* allocator, void* memory, bool allocatNodesSeperately) |
| 691 | { |