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

Function ZWRAP_createDCtx

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

Source from the content-addressed store, hash-verified

524}
525
526static ZWRAP_DCtx* ZWRAP_createDCtx(z_streamp strm)
527{
528 ZWRAP_DCtx* zwd;
529 ZSTD_customMem customMem = { NULL, NULL, NULL };
530
531 if (strm->zalloc && strm->zfree) {
532 customMem.customAlloc = ZWRAP_allocFunction;
533 customMem.customFree = ZWRAP_freeFunction;
534 }
535 customMem.opaque = strm;
536
537 zwd = (ZWRAP_DCtx*)ZWRAP_customCalloc(sizeof(ZWRAP_DCtx), customMem);
538 if (zwd == NULL) return NULL;
539 zwd->allocFunc = *strm;
540 customMem.opaque = &zwd->allocFunc;
541 zwd->customMem = customMem;
542
543 ZWRAP_initDCtx(zwd);
544 return zwd;
545}
546
547static size_t ZWRAP_freeDCtx(ZWRAP_DCtx* zwd)
548{

Callers 1

zstd_zlibwrapper.cFile · 0.85

Calls 2

ZWRAP_customCallocFunction · 0.85
ZWRAP_initDCtxFunction · 0.85

Tested by

no test coverage detected