buffer_test: fix computation of the number of bytes cleared.

geesefs-0-30-9
Aaron Jacobs 2016-12-19 13:14:05 +11:00
parent 40b516328e
commit 10bc0e766c
1 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,7 @@ func BenchmarkOutMessageReset(b *testing.B) {
om.Reset()
}
b.SetBytes(int64(om.offset))
b.SetBytes(int64(unsafe.Offsetof(om.storage)) + int64(om.offset))
})
// Many megabytes worth of buffers, which should defeat the CPU cache.
@ -321,7 +321,7 @@ func BenchmarkOutMessageReset(b *testing.B) {
oms[i%numMessages].Reset()
}
b.SetBytes(int64(oms[0].offset))
b.SetBytes(int64(unsafe.Offsetof(oms[0].storage)) + int64(oms[0].offset))
})
}