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

Function hi_malloc_safe

deps/hiredis/test.c:1088–1096  ·  view source on GitHub ↗

Wrap malloc to abort on failure so OOM checks don't make the test logic * harder to follow. */

Source from the content-addressed store, hash-verified

1086/* Wrap malloc to abort on failure so OOM checks don't make the test logic
1087 * harder to follow. */
1088void *hi_malloc_safe(size_t size) {
1089 void *ptr = hi_malloc(size);
1090 if (ptr == NULL) {
1091 fprintf(stderr, "Error: Out of memory\n");
1092 exit(-1);
1093 }
1094
1095 return ptr;
1096}
1097
1098static void test_throughput(struct config config) {
1099 redisContext *c = do_connect(config);

Callers 1

test_throughputFunction · 0.85

Calls 1

hi_mallocFunction · 0.70

Tested by

no test coverage detected