Skip to content

Commit 8671f9d

Browse files
chore: fix outdated comments regarding file size (#1965)
The file size used for the discard stats is `1<<20` (1MB), but the comments say that it's 1GB.
1 parent a086cda commit 8671f9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ const discardFname string = "DISCARD"
4242
func InitDiscardStats(opt Options) (*discardStats, error) {
4343
fname := filepath.Join(opt.ValueDir, discardFname)
4444

45-
// 1GB file can store 67M discard entries. Each entry is 16 bytes.
45+
// 1MB file can store 65.536 discard entries. Each entry is 16 bytes.
4646
mf, err := z.OpenMmapFile(fname, os.O_CREATE|os.O_RDWR, 1<<20)
4747
lf := &discardStats{
4848
MmapFile: mf,
4949
opt: opt,
5050
}
5151
if err == z.NewFile {
52-
// We don't need to zero out the entire 1GB.
52+
// We don't need to zero out the entire 1MB.
5353
lf.zeroOut()
5454

5555
} else if err != nil {

0 commit comments

Comments
 (0)