return0;/* over-simplification; could also check if context is currently running in streaming mode, and in which case, report how many bytes are left to be flushed within output buffer */
FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable,defaultNorm,defaultMax,defaultNormLog,workspace,workspaceSize));/* note : could be pre-calculated */
FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable,defaultNorm,defaultMax,defaultNormLog,entropyWorkspace,entropyWorkspaceSize));/* note : could be pre-calculated */
assert(avgJobSize>=256KB);/* condition for ZSTD_compressBound(A) + ZSTD_compressBound(B) <= ZSTD_compressBound(A+B), required to compress directly into Dst (no additional buffer) */
ZSTD_wildcopy_16min(op,(*litPtr),sequence.litLength,ZSTD_no_overlap);/* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
else
ZSTD_copy8(op,*litPtr);
/* bounds checks */
assert(oLitEnd<oMatchEnd);
RETURN_ERROR_IF(oMatchEnd>oend,dstSize_tooSmall,"last match must fit within dstBuffer");
RETURN_ERROR_IF(iLitEnd>litLimit,corruption_detected,"try to read beyond literal buffer");
ZSTD_wildcopy_16min(op,*litPtr,sequence.litLength,ZSTD_no_overlap);/* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
PREFETCH_L1(sequence.match);PREFETCH_L1(sequence.match+sequence.matchLength-1);/* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
* These functions make it possible to estimate memory usage
* of a future {D,C}Ctx, before its creation.
* ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one.
* It will also consider src size to be arbitrarily "large", which is worst case.
* If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation.
* ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
* ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1.
* Note : CCtx size estimation is only correct for single-threaded compression. */
* These functions make it possible to estimate memory usage of a future
* {D,C}Ctx, before its creation.
*
* ZSTD_estimateCCtxSize() will provide a budget large enough for any
* compression level up to selected one. Unlike ZSTD_estimateCStreamSize*(),
* this estimate does not include space for a window buffer, so this estimate
* is guaranteed to be enough for single-shot compressions, but not streaming
* compressions. It will however assume the input may be arbitrarily large,
* which is the worst case. If srcSize is known to always be small,
* ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation.
* ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with
* ZSTD_getCParams() to create cParams from compressionLevel.
* ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with
* ZSTD_CCtxParams_setParameter().
*
* Note: only single-threaded compression is supported. This function will
* return an error code if ZSTD_c_nbWorkers is >= 1. */