Skip to content

Commit

Permalink
gzip tests: private allocBytesPerRun
Browse files Browse the repository at this point in the history
Co-Authored-By: Klaus Post <[email protected]>
  • Loading branch information
wojas and klauspost authored Feb 12, 2020
1 parent 3442556 commit a13a592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gzip_norace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestAllocations(t *testing.T) {
}
}

// AllocBytesPerRUn returns the average total size of allocations during calls to f.
// allocBytesPerRun returns the average total size of allocations during calls to f.
// The return value is in bytes.
//
// To compute the number of allocations, the function will first be run once as
Expand All @@ -50,7 +50,7 @@ func TestAllocations(t *testing.T) {
//
// This function is based on testing.AllocsPerRun, which counts the number of
// allocations instead of the total size of them in bytes.
func AllocBytesPerRun(runs int, f func()) (avg float64) {
func allocBytesPerRun(runs int, f func()) (avg float64) {
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
// Disable garbage collector, because it could clear our pools during the run
oldGCPercent := debug.SetGCPercent(-1)
Expand Down

0 comments on commit a13a592

Please sign in to comment.