MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ZWRAP_customCalloc

Function ZWRAP_customCalloc

freebsd/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c:128–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128static void* ZWRAP_customCalloc(size_t size, ZSTD_customMem customMem)
129{
130 if (customMem.customAlloc) {
131 /* calloc implemented as malloc+memset;
132 * not as efficient as calloc, but next best guess for custom malloc */
133 void* const ptr = customMem.customAlloc(customMem.opaque, size);
134 memset(ptr, 0, size);
135 return ptr;
136 }
137 return calloc(1, size);
138}
139
140static void ZWRAP_customFree(void* ptr, ZSTD_customMem customMem)
141{

Callers 2

ZWRAP_createCCtxFunction · 0.85
ZWRAP_createDCtxFunction · 0.85

Calls 2

memsetFunction · 0.85
callocFunction · 0.85

Tested by

no test coverage detected