mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-17 08:18:07 -04:00
Fix window size initialization and div-by-zero
This commit is contained in:
parent
3a78ab9ce4
commit
ebe92f9540
@ -279,7 +279,7 @@ class block_manager_ final : public block_manager::impl {
|
||||
, window_size_{cfg.blockhash_window_size > 0
|
||||
? static_cast<size_t>(1) << cfg.blockhash_window_size
|
||||
: 0}
|
||||
, window_step_{window_size_ >> cfg.window_increment_shift}
|
||||
, window_step_{std::max<size_t>(1, window_size_ >> cfg.window_increment_shift)}
|
||||
, block_size_{static_cast<size_t>(1) << cfg.block_size_bits}
|
||||
, filter_{bloom_filter_size()} {
|
||||
LOG_INFO << "bloom filter size: " << size_with_unit(filter_.size() / 8);
|
||||
|
@ -549,7 +549,7 @@ int mkdwarfs(int argc, char** argv) {
|
||||
metadata_compression = defaults.metadata_compression;
|
||||
}
|
||||
|
||||
if (!vm.count("blockhash-window-size")) {
|
||||
if (!vm.count("window-size")) {
|
||||
cfg.blockhash_window_size = defaults.window_size;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user