1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-07 06:23:00 +03:00

[pzstd] Fix and test 32 bit support

This commit is contained in:
Nick Terrell
2016-09-21 17:47:09 -07:00
parent 5c9adff7f8
commit 0a5910b23b
3 changed files with 69 additions and 12 deletions

View File

@@ -333,10 +333,9 @@ static size_t calculateStep(
size_t step = size_t{1} << (params.cParams.windowLog + 2);
// If file size is known, see if a smaller step will spread work more evenly
if (size != 0) {
const std::uintmax_t newStep = size / std::uintmax_t{numThreads};
if (newStep != 0 &&
newStep <= std::uintmax_t{std::numeric_limits<size_t>::max()}) {
step = std::min(step, size_t{newStep});
const std::uintmax_t newStep = size / numThreads;
if (newStep != 0 && newStep <= std::numeric_limits<size_t>::max()) {
step = std::min(step, static_cast<size_t>(newStep));
}
}
return step;