MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / TEST

Function TEST

tests/allocator_test.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#endif
32
33TEST(Allocator, Free) {
34 SimpleAllocator a;
35 MEMSTAT_ISEMPTY();
36 void *ptr = a.Malloc(24);
37 MEMSTAT_NOTEMPTY();
38 ptr = a.Realloc(ptr, 24, 48);
39 MEMSTAT_NOTEMPTY();
40 ptr = a.Realloc(ptr, 48, 96);
41 a.Free(ptr);
42 MEMSTAT_ISEMPTY();
43 EXPECT_NE(ptr, nullptr);
44}
45
46} // namespace

Callers

nothing calls this directly

Calls 3

MallocMethod · 0.45
ReallocMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected