Commit 2f2d4c6b authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

net: ensure that Read/Write on all platforms do 0 mallocs

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12780045
parent 06e686de
......@@ -456,12 +456,6 @@ func TestTCPReadWriteMallocs(t *testing.T) {
if testing.Short() {
t.Skip("skipping malloc count in short mode")
}
maxMallocs := 10000
switch runtime.GOOS {
// Add other OSes if you know how many mallocs they do.
case "windows":
maxMallocs = 0
}
ln, err := Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatalf("Listen failed: %v", err)
......@@ -493,8 +487,8 @@ func TestTCPReadWriteMallocs(t *testing.T) {
t.Fatalf("Read failed: %v", err)
}
})
if int(mallocs) > maxMallocs {
t.Fatalf("Got %v allocs, want %v", mallocs, maxMallocs)
if mallocs > 0 {
t.Fatalf("Got %v allocs, want 0", mallocs)
}
}
......
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