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

Method reallocMemory

src/CppUTest/MemoryLeakDetector.cpp:707–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately)
708{
709#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK
710 allocatNodesSeperately = true;
711#endif
712 if (memory) {
713 MemoryLeakDetectorNode* node = memoryTable_.removeNode(memory);
714 if (node == NULLPTR) {
715 outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_);
716 return NULLPTR;
717 }
718 checkForCorruption(node, file, line, allocator, allocatNodesSeperately);
719 }
720 return reallocateMemoryAndLeakInformation(allocator, memory, size, file, line, allocatNodesSeperately);
721}
722
723void MemoryLeakDetector::ConstructMemoryLeakReport(MemLeakPeriod period)
724{

Callers 3

mem_leak_reallocFunction · 0.80
TESTFunction · 0.80

Calls 2

removeNodeMethod · 0.80

Tested by 1

TESTFunction · 0.64