From 26fa6967131dd0c48e0cacce429ed81d1f21356d Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 26 Nov 2015 16:07:08 +0100 Subject: [PATCH] minor API change --- lib/zstd_compress.c | 6 +++--- lib/zstd_static.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index f7a83de8..5a825b84 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -2074,9 +2074,9 @@ ZSTD_parameters ZSTD_getParams(int compressionLevel, U64 srcSizeHint) } -size_t ZSTD_compressBegin(ZSTD_CCtx* ctx, void* dst, size_t maxDstSize, int compressionLevel, U64 srcSizeHint) +size_t ZSTD_compressBegin(ZSTD_CCtx* ctx, void* dst, size_t maxDstSize, int compressionLevel) { - return ZSTD_compressBegin_advanced(ctx, dst, maxDstSize, ZSTD_getParams(compressionLevel, srcSizeHint)); + return ZSTD_compressBegin_advanced(ctx, dst, maxDstSize, ZSTD_getParams(compressionLevel, 0)); } @@ -2140,6 +2140,6 @@ size_t ZSTD_compress(void* dst, size_t maxDstSize, const void* src, size_t srcSi ZSTD_CCtx ctxBody; memset(&ctxBody, 0, sizeof(ctxBody)); result = ZSTD_compressCCtx(&ctxBody, dst, maxDstSize, src, srcSize, compressionLevel); - free(ctxBody.workSpace); /* can't free ctxBody, since it's on stack; take care of heap content */ + free(ctxBody.workSpace); /* can't free ctxBody, since it's on stack; free heap content */ return result; } diff --git a/lib/zstd_static.h b/lib/zstd_static.h index ed06d69d..f0656c94 100644 --- a/lib/zstd_static.h +++ b/lib/zstd_static.h @@ -102,7 +102,7 @@ size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx, /* ************************************** * Streaming functions (bufferless mode) ****************************************/ -size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, void* dst, size_t maxDstSize, int compressionLevel, U64 srcSizeHint); +size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, void* dst, size_t maxDstSize, int compressionLevel); size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* ctx, void* dst, size_t maxDstSize, ZSTD_parameters params); size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t maxDstSize, const void* src, size_t srcSize);