From 97d60acd89addfea059e91dec132f283c699c4b6 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sun, 5 Jun 2022 11:21:28 -0700 Subject: updated documentation of LZ4F_freeCompressionContext to answer #1090 --- lib/lz4frame.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/lz4frame.h b/lib/lz4frame.h index 74f19cd..6bf20e4 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -243,13 +243,16 @@ typedef struct { LZ4FLIB_API unsigned LZ4F_getVersion(void); /*! LZ4F_createCompressionContext() : - * The first thing to do is to create a compressionContext object, which will be used in all compression operations. + * The first thing to do is to create a compressionContext object, + * which will keep track of operation state during streaming compression. * This is achieved using LZ4F_createCompressionContext(), which takes as argument a version. * The version provided MUST be LZ4F_VERSION. It is intended to track potential version mismatch, notably when using DLL. * The function will provide a pointer to a fully allocated LZ4F_cctx object. - * If @return != zero, there was an error during context creation. - * Object can be released using LZ4F_freeCompressionContext(); - * Note: LZ4F_freeCompressionContext() works with NULL pointers (do nothing). + * If @return != zero, there context creation failed. + * Once all streaming compression jobs are completed, + * the state object can be released using LZ4F_freeCompressionContext(). + * Note1 : LZ4F_freeCompressionContext() is always successful. Its return value can be ignored. + * Note2 : LZ4F_freeCompressionContext() works fine with NULL input pointers (do nothing). */ LZ4FLIB_API LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_cctx** cctxPtr, unsigned version); LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx* cctx); -- cgit v0.12