Commit 10bc0e76 authored by Aaron Jacobs's avatar Aaron Jacobs

buffer_test: fix computation of the number of bytes cleared.

parent 40b51632
......@@ -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))
})
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment