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

Function ZSTD_freeCCtx

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

Source from the content-addressed store, hash-verified

13229}
13230
13231size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx)
13232{
13233 if (cctx==NULL) return 0; /* support free on NULL */
13234 RETURN_ERROR_IF(cctx->staticSize, memory_allocation,
13235 "not compatible with static CCtx");
13236 {
13237 int cctxInWorkspace = ZSTD_cwksp_owns_buffer(&cctx->workspace, cctx);
13238 ZSTD_freeCCtxContent(cctx);
13239 if (!cctxInWorkspace) {
13240 ZSTD_free(cctx, cctx->customMem);
13241 }
13242 }
13243 return 0;
13244}
13245
13246
13247static size_t ZSTD_sizeof_mtctx(const ZSTD_CCtx* cctx)

Callers 3

ZSTD_freeCStreamFunction · 0.70
zfs_zstd_compressFunction · 0.50
zstdio_finiFunction · 0.50

Calls 3

ZSTD_freeFunction · 0.85
ZSTD_cwksp_owns_bufferFunction · 0.70
ZSTD_freeCCtxContentFunction · 0.70

Tested by

no test coverage detected