// ("quick keys") as well as long keys.
func TestSingleBucketMapStringKeys_DupLen(t *testing.T) {
testMapLookups(t, map[string]string{
- "x": "x1val",
- "xx": "x2val",
- "foo": "fooval",
- "bar": "barval", // same key length as "foo"
- "xxxx": "x4val",
+ "x": "x1val",
+ "xx": "x2val",
+ "foo": "fooval",
+ "bar": "barval", // same key length as "foo"
+ "xxxx": "x4val",
strings.Repeat("x", 128): "longval1",
strings.Repeat("y", 128): "longval2",
})
// If s was scavenged, then t may be scavenged.
start, end := t.physPageBounds()
if s.scavenged && start < end {
- memstats.heap_released += uint64(end-start)
+ memstats.heap_released += uint64(end - start)
t.scavenged = true
}
s.state = mSpanManual // prevent coalescing with s
//
// This check also preserves the invariant that spans that have
// `scavenged` set are only ever in the `scav` treap, and
- // those which have it unset are only in the `free` treap.
+ // those which have it unset are only in the `free` treap.
return
}
prev := t.pred()
for t != nil {
s := t.spanKey
next := t.succ()
- if (now-uint64(s.unusedsince)) > limit {
+ if (now - uint64(s.unusedsince)) > limit {
r := s.scavenge()
if r != 0 {
// If we ended up scavenging s, then remove it from unscav