mirror of
https://github.com/facebook/zstd.git
synced 2026-01-06 11:21:19 +03:00
fixed : Visual build compressing stdin with multi-threading enabled fails
It was multiple reasons stacked : - Visual use a different code path, because ZSTD_NEWAPI is not defined - fileio.c sends `0` as `pledgedSrcSize` to mean `ZSTD_CONTENTSIZE_UNKNOWN` (fixed) - ZSTDMT_resetCCtx() interpreted `0` as "empty" instead of "unknown" (fixed)
This commit is contained in:
@@ -817,11 +817,11 @@ static int FIO_compressFilename_internal(cRess_t ress,
|
||||
/* init */
|
||||
#ifdef ZSTD_NEWAPI
|
||||
if (fileSize!=0) /* when src is stdin, fileSize==0, but is effectively unknown */
|
||||
ZSTD_CCtx_setPledgedSrcSize(ress.cctx, fileSize); /* note : fileSize==0 means "empty" */
|
||||
ZSTD_CCtx_setPledgedSrcSize(ress.cctx, fileSize);
|
||||
#elif defined(ZSTD_MULTITHREAD)
|
||||
CHECK( ZSTDMT_resetCStream(ress.cctx, fileSize) ); /* note : fileSize==0 means "unknown" */
|
||||
CHECK( ZSTDMT_resetCStream(ress.cctx, fileSize ? fileSize : ZSTD_CONTENTSIZE_UNKNOWN) );
|
||||
#else
|
||||
CHECK( ZSTD_resetCStream(ress.cctx, fileSize) ); /* note : fileSize==0 means "unknown" */
|
||||
CHECK( ZSTD_resetCStream(ress.cctx, fileSize ? fileSize : ZSTD_CONTENTSIZE_UNKNOWN) );
|
||||
#endif
|
||||
|
||||
/* Main compression loop */
|
||||
|
||||
Reference in New Issue
Block a user