Ejemplo n.º 1
0
char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately)
{
    if (memory) {
        MemoryLeakDetectorNode* node = memoryTable_.removeNode(memory);
        if (node == NULL) {
            outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_);
            return NULL;
        }
        checkForCorruption(node, file, line, allocator, allocatNodesSeperately);
    }
    return reallocateMemoryAndLeakInformation(allocator, memory, size, file, line, allocatNodesSeperately);
}
Ejemplo n.º 2
0
char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately)
{
	if (memory) {
		MemoryLeakDetectorNode* node = memoryTable_.removeNode(memory);
		if (node == NULL) {
			reportFailure(MEM_LEAK_DEALLOC_NON_ALLOCATED, "<unknown>", 0, 0, NullUnknownAllocator::defaultAllocator(), file, line, allocator);
			return NULL;
		}
		checkForCorruption(node, file, line, allocator, allocatNodesSeperately);
	}
	return reallocateMemoryAndLeakInformation(allocator, memory, size, file, line, allocatNodesSeperately);
}