mirror of
https://github.com/facebook/zstd.git
synced 2025-10-16 00:04:24 -04:00
ZSTD_createCCtx_advanced() now uses ZSTD_calloc()
initially uses calloc() instead of memset(). Performance improvement is unlikely measurable, since ZSTD_CCtx is now very small, with all tables transferred into workSpace.
This commit is contained in:
parent
deee6e523f
commit
c4f46b94ce
@ -167,9 +167,8 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
|||||||
|
|
||||||
if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
|
if (!customMem.customAlloc ^ !customMem.customFree) return NULL;
|
||||||
|
|
||||||
cctx = (ZSTD_CCtx*) ZSTD_malloc(sizeof(ZSTD_CCtx), customMem);
|
cctx = (ZSTD_CCtx*) ZSTD_calloc(sizeof(ZSTD_CCtx), customMem);
|
||||||
if (!cctx) return NULL;
|
if (!cctx) return NULL;
|
||||||
memset(cctx, 0, sizeof(ZSTD_CCtx));
|
|
||||||
cctx->customMem = customMem;
|
cctx->customMem = customMem;
|
||||||
cctx->compressionLevel = ZSTD_CLEVEL_DEFAULT;
|
cctx->compressionLevel = ZSTD_CLEVEL_DEFAULT;
|
||||||
return cctx;
|
return cctx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user