MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / zmalloc_test

Function zmalloc_test

src/zmalloc.cpp:695–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693#ifdef REDIS_TEST
694#define UNUSED(x) ((void)(x))
695int zmalloc_test(int argc, char **argv, int accurate) {
696 void *ptr;
697
698 UNUSED(argc);
699 UNUSED(argv);
700 UNUSED(accurate);
701 printf("Malloc prefix size: %d\n", (int) PREFIX_SIZE);
702 printf("Initial used memory: %zu\n", zmalloc_used_memory());
703 ptr = zmalloc(123);
704 printf("Allocated 123 bytes; used: %zu\n", zmalloc_used_memory());
705 ptr = zrealloc(ptr, 456);
706 printf("Reallocated to 456 bytes; used: %zu\n", zmalloc_used_memory());
707 zfree(ptr);
708 printf("Freed pointer; used: %zu\n", zmalloc_used_memory());
709 return 0;
710}
711#endif

Callers

nothing calls this directly

Calls 4

zmalloc_used_memoryFunction · 0.85
zmallocFunction · 0.85
zreallocFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected