예제 #1
0
TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator)
{
    allocator = new TestMemoryAllocator("malloc_allocator");
    setCurrentMallocAllocator(allocator);
    POINTERS_EQUAL(allocator, getCurrentMallocAllocator());
    setCurrentMallocAllocatorToDefault();
    POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator());
}
예제 #2
0
MemoryReportFormatter* MemoryReporterPlugin::createMemoryFormatter(const SimpleString& type)
{
	if (type == "normal") {
		return  new NormalMemoryReportFormatter;
	}
	else if (type == "code") {
		return new CodeMemoryReportFormatter(defaultMallocAllocator());
	}
	return NULL;
}
예제 #3
0
TEST(TestMemoryAllocatorTest, MallocNames)
{
    STRCMP_EQUAL("Standard Malloc Allocator", defaultMallocAllocator()->name());
    STRCMP_EQUAL("malloc", defaultMallocAllocator()->alloc_name());
    STRCMP_EQUAL("free", defaultMallocAllocator()->free_name());
}
예제 #4
0
void setCurrentMallocAllocatorToDefault()
{
    currentMallocAllocator = defaultMallocAllocator();
}