Skip to content

Commit 29a7d27

Browse files
authored
zstd: Fix incorrect buffer size in dictionary encodes (#1059)
Fix incorrect dLongTableShardSize leading to inefficient zeroing of Also make shards 128 bytes to reduce memory use somewhat.
1 parent 517288e commit 29a7d27

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

zstd/enc_base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const (
11-
dictShardBits = 6
11+
dictShardBits = 7
1212
)
1313

1414
type fastBase struct {

zstd/enc_dfast.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const (
1313
dFastLongLen = 8 // Bytes used for table hash
1414

1515
dLongTableShardCnt = 1 << (dFastLongTableBits - dictShardBits) // Number of shards in the table
16-
dLongTableShardSize = dFastLongTableSize / tableShardCnt // Size of an individual shard
16+
dLongTableShardSize = dFastLongTableSize / dLongTableShardCnt // Size of an individual shard
1717

1818
dFastShortTableBits = tableBits // Bits used in the short match table
1919
dFastShortTableSize = 1 << dFastShortTableBits // Size of the table

0 commit comments

Comments
 (0)