Пример #1
0
static char* checkedMalloc(size_t size)
{
    char* mem = (char*) PlatformSpecificMalloc(size);
    if (mem == 0)
    FAIL("malloc returned null pointer");
    return mem;
}
Пример #2
0
static SimpleString addMarkerToString(const SimpleString& str, int markerPos)
{
	size_t bufferSize = str.size()+1;
	char* buffer = (char*) PlatformSpecificMalloc(bufferSize);
	str.copyToBuffer(buffer, bufferSize);

	buffer[markerPos] = '^';

	SimpleString result(buffer);
	PlatformSpecificFree(buffer);
	return result;

}
Пример #3
0
static SimpleString removeAllPrintableCharactersFrom(const SimpleString& str)
{
	size_t bufferSize = str.size()+1;
	char* buffer = (char*) PlatformSpecificMalloc(bufferSize);
	str.copyToBuffer(buffer, bufferSize);

	for (size_t i = 0; i < bufferSize-1; i++)
		if (buffer[i] != '\t' && buffer[i] != '\n')
			buffer[i] = ' ';

	SimpleString result(buffer);
	PlatformSpecificFree(buffer);
	return result;
}
Пример #4
0
char* FailableMemoryAllocator::allocMemoryLeakNode(size_t size)
{
    return (char*)PlatformSpecificMalloc(size);
}
static void* normal_operator_new_array_nothrow (size_t size) UT_THROW_EMPTY()
{
	return PlatformSpecificMalloc(size);
}
static void* normal_malloc(size_t size, const char*, int)
{
	return PlatformSpecificMalloc(size);
}