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

Function zmalloc

src/zmalloc.cpp:130–134  ·  view source on GitHub ↗

Allocate memory or panic */

Source from the content-addressed store, hash-verified

128
129/* Allocate memory or panic */
130void *zmalloc(size_t size, enum MALLOC_CLASS /*mclass*/) {
131 void *ptr = ztrymalloc_usable(size, NULL);
132 if (!ptr) zmalloc_oom_handler(size);
133 return ptr;
134}
135
136/* Try allocating memory, and return NULL if failed. */
137void *ztrymalloc(size_t size) {

Callers 15

stressGetKeysFunction · 0.85
backupDbFunction · 0.85
getKeysPrepareResultFunction · 0.85
slotToKeyUpdateKeyCoreFunction · 0.85
lwCreateCanvasFunction · 0.85
listCreateFunction · 0.85
listAddNodeHeadFunction · 0.85
listAddNodeTailFunction · 0.85
listInsertNodeFunction · 0.85
listGetIteratorFunction · 0.85
bulkInsertMethod · 0.85
cliInitHelpFunction · 0.85

Calls 1

ztrymalloc_usableFunction · 0.85

Tested by

no test coverage detected