summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2022-07-11 12:04:41 (GMT)
committerYann Collet <cyan@fb.com>2022-07-12 19:28:12 (GMT)
commitd174f975d218c8d2c4df79da3b80a11c50c59e5a (patch)
tree9497dfa2ea331dff8757687007b9d7c87b382144 /lib/lz4hc.c
parent91802083b381f7c9bfc43ffb9a60a29ff2941efc (diff)
downloadlz4-d174f975d218c8d2c4df79da3b80a11c50c59e5a.zip
lz4-d174f975d218c8d2c4df79da3b80a11c50c59e5a.tar.gz
lz4-d174f975d218c8d2c4df79da3b80a11c50c59e5a.tar.bz2
clarify static sizes of states for static allocation
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r--lib/lz4hc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 99650a6..77b4767 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -1005,8 +1005,6 @@ int LZ4_freeStreamHC (LZ4_streamHC_t* LZ4_streamHCPtr)
LZ4_streamHC_t* LZ4_initStreamHC (void* buffer, size_t size)
{
LZ4_streamHC_t* const LZ4_streamHCPtr = (LZ4_streamHC_t*)buffer;
- /* if compilation fails here, LZ4_STREAMHCSIZE must be increased */
- LZ4_STATIC_ASSERT(sizeof(LZ4HC_CCtx_internal) <= LZ4_STREAMHCSIZE);
DEBUGLOG(4, "LZ4_initStreamHC(%p, %u)", buffer, (unsigned)size);
/* check conditions */
if (buffer == NULL) return NULL;
@@ -1205,7 +1203,7 @@ int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* ctx, const char* src,
/* Deprecated streaming functions */
-int LZ4_sizeofStreamStateHC(void) { return LZ4_STREAMHCSIZE; }
+int LZ4_sizeofStreamStateHC(void) { return sizeof(LZ4_streamHC_t); }
/* state is presumed correctly sized, aka >= sizeof(LZ4_streamHC_t)
* @return : 0 on success, !=0 if error */