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

Function checkedMalloc

src/CppUTest/TestMemoryAllocator.cpp:33–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include "CppUTest/MemoryLeakDetector.h"
32
33static char* checkedMalloc(size_t size)
34{
35 char* mem = (char*) PlatformSpecificMalloc(size);
36 if (mem == NULLPTR)
37 FAIL("malloc returned null pointer");
38 return mem;
39}
40
41static TestMemoryAllocator* currentNewAllocator = NULLPTR;
42static TestMemoryAllocator* currentNewArrayAllocator = NULLPTR;

Callers 1

alloc_memoryMethod · 0.85

Calls 1

PlatformSpecificMallocFunction · 0.85

Tested by

no test coverage detected