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

Function ZSTD_calloc

freebsd/contrib/openzfs/module/zstd/lib/zstd.c:7380–7390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7378}
7379
7380void* ZSTD_calloc(size_t size, ZSTD_customMem customMem)
7381{
7382 if (customMem.customAlloc) {
7383 /* calloc implemented as malloc+memset;
7384 * not as efficient as calloc, but next best guess for custom malloc */
7385 void* const ptr = customMem.customAlloc(customMem.opaque, size);
7386 memset(ptr, 0, size);
7387 return ptr;
7388 }
7389 return calloc(1, size);
7390}
7391
7392void ZSTD_free(void* ptr, ZSTD_customMem customMem)
7393{

Callers 3

POOL_create_advancedFunction · 0.85
ZSTD_customCallocFunction · 0.85

Calls 2

memsetFunction · 0.85
callocFunction · 0.85

Tested by

no test coverage detected