Skip to content

Commit

Permalink
chore: fix outdated comments regarding file size (#1965)
Browse files Browse the repository at this point in the history
The file size used for the discard stats is `1<<20` (1MB), but the
comments say that it's 1GB.
  • Loading branch information
kevinmingtarja authored Jun 6, 2023
1 parent a086cda commit 8671f9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discard.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ const discardFname string = "DISCARD"
func InitDiscardStats(opt Options) (*discardStats, error) {
fname := filepath.Join(opt.ValueDir, discardFname)

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

} else if err != nil {
Expand Down

0 comments on commit 8671f9d

Please sign in to comment.