Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(751)

Side by Side Diff: src/pkg/runtime/map_test.go

Issue 7722046: code review 7722046: runtime: allocate first bucket table lazily (Closed)
Patch Set: diff -r 3d477c8de1c2 https://go.googlecode.com/hg/ Created 11 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/hashmap.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package runtime_test 5 package runtime_test
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "math" 9 "math"
10 "runtime" 10 "runtime"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 b[empty{}] = 1 273 b[empty{}] = 1
274 c[empty{}] = empty{} 274 c[empty{}] = empty{}
275 275
276 if len(a) != 1 { 276 if len(a) != 1 {
277 t.Errorf("empty value insert problem") 277 t.Errorf("empty value insert problem")
278 } 278 }
279 if b[empty{}] != 1 { 279 if b[empty{}] != 1 {
280 t.Errorf("empty key returned wrong value") 280 t.Errorf("empty key returned wrong value")
281 } 281 }
282 } 282 }
283
284 func BenchmarkNewEmptyMap(b *testing.B) {
285 b.ReportAllocs()
286 for i := 0; i < b.N; i++ {
287 _ = make(map[int]int)
288 }
289 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/hashmap.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b