mirror of
https://github.com/facebook/zstd.git
synced 2024-11-28 19:36:57 +08:00
zstdmt : fixed last job size
This commit is contained in:
parent
3ad7d4951c
commit
a7ef3a219c
@ -1220,7 +1220,8 @@ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx,
|
||||
if ( (mtctx->jobReady)
|
||||
|| (mtctx->inBuff.filled >= newJobThreshold) /* filled enough : let's compress */
|
||||
|| ( (endOp != ZSTD_e_continue) && (mtctx->inBuff.filled > 0) ) ) { /* avoid overwriting job round buffer */
|
||||
CHECK_F( ZSTDMT_createCompressionJob(mtctx, mtctx->targetSectionSize, 0 /* endFrame */) );
|
||||
size_t const jobSize = MIN(mtctx->inBuff.filled - mtctx->prefixSize, mtctx->targetSectionSize);
|
||||
CHECK_F( ZSTDMT_createCompressionJob(mtctx, jobSize, endOp==ZSTD_e_end) );
|
||||
}
|
||||
|
||||
/* check for potential compressed data ready to be flushed */
|
||||
|
Loading…
Reference in New Issue
Block a user