return f
}
-func mapbucket(t *types.Type) *types.Type {
+// bmap makes the map bucket type given the type of the map.
+func bmap(t *types.Type) *types.Type {
if t.MapType().Bucket != nil {
return t.MapType().Bucket
}
Fatalf("bucket align not multiple of value align %v", t)
}
if keys.Offset%int64(keytype.Align) != 0 {
- Fatalf("bad alignment of keys in mapbucket for %v", t)
+ Fatalf("bad alignment of keys in bmap for %v", t)
}
if values.Offset%int64(valtype.Align) != 0 {
- Fatalf("bad alignment of values in mapbucket for %v", t)
+ Fatalf("bad alignment of values in bmap for %v", t)
}
// Double-check that overflow field is final memory in struct,
// with no padding at end. See comment above.
if overflow.Offset != bucket.Width-int64(Widthptr) {
- Fatalf("bad offset of overflow in mapbucket for %v", t)
+ Fatalf("bad offset of overflow in bmap for %v", t)
}
t.MapType().Bucket = bucket
return t.MapType().Hmap
}
- bmap := mapbucket(t)
+ bmap := bmap(t)
// build a struct:
// type hmap struct {
}
hmap := hmap(t)
- bmap := mapbucket(t)
+ bmap := bmap(t)
// build a struct:
// type hiter struct {
case TMAP:
s1 := dtypesym(t.Key())
s2 := dtypesym(t.Val())
- s3 := dtypesym(mapbucket(t))
+ s3 := dtypesym(bmap(t))
s4 := dtypesym(hmap(t))
ot = dcommontype(lsym, ot, t)
ot = dsymptr(lsym, ot, s1.Linksym(), 0)
ot = duint8(lsym, ot, 0) // not indirect
}
- ot = duint16(lsym, ot, uint16(mapbucket(t).Width))
+ ot = duint16(lsym, ot, uint16(bmap(t).Width))
ot = duint8(lsym, ot, uint8(obj.Bool2int(isreflexive(t.Key()))))
ot = duint8(lsym, ot, uint8(obj.Bool2int(needkeyupdate(t.Key()))))
ot = dextratype(lsym, ot, t, 0)