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

Function ZSTD_customCalloc

freebsd/contrib/zstd/lib/common/zstd_common.c:63–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
64{
65 if (customMem.customAlloc) {
66 /* calloc implemented as malloc+memset;
67 * not as efficient as calloc, but next best guess for custom malloc */
68 void* const ptr = customMem.customAlloc(customMem.opaque, size);
69 ZSTD_memset(ptr, 0, size);
70 return ptr;
71 }
72 return ZSTD_calloc(1, size);
73}
74
75void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
76{

Callers 6

POOL_create_advancedFunction · 0.85
ZSTDMT_createBufferPoolFunction · 0.85
ZSTDMT_createCCtxPoolFunction · 0.85
ZSTDMT_createJobsTableFunction · 0.85

Calls 1

ZSTD_callocFunction · 0.85

Tested by

no test coverage detected