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

Function ZWRAP_createCCtx

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

Source from the content-addressed store, hash-verified

179
180
181static ZWRAP_CCtx* ZWRAP_createCCtx(z_streamp strm)
182{
183 ZWRAP_CCtx* zwc;
184 ZSTD_customMem customMem = { NULL, NULL, NULL };
185
186 if (strm->zalloc && strm->zfree) {
187 customMem.customAlloc = ZWRAP_allocFunction;
188 customMem.customFree = ZWRAP_freeFunction;
189 }
190 customMem.opaque = strm;
191
192 zwc = (ZWRAP_CCtx*)ZWRAP_customCalloc(sizeof(ZWRAP_CCtx), customMem);
193 if (zwc == NULL) return NULL;
194 zwc->allocFunc = *strm;
195 customMem.opaque = &zwc->allocFunc;
196 zwc->customMem = customMem;
197
198 return zwc;
199}
200
201
202static int ZWRAP_initializeCStream(ZWRAP_CCtx* zwc, const void* dict, size_t dictSize, unsigned long long pledgedSrcSize)

Callers 1

zstd_zlibwrapper.cFile · 0.85

Calls 1

ZWRAP_customCallocFunction · 0.85

Tested by

no test coverage detected