funchashGrow(t*maptype,h*hmap){//判断是否需要sameSizeGrow,否则"真"扩
bigger:=uint8(1)if!overLoadFactor(h.count+1,h.B){bigger=0h.flags|=sameSizeGrow}// 将buckets复制给oldbuckets
oldbuckets:=h.bucketsnewbuckets,nextOverflow:=makeBucketArray(t,h.B+bigger,nil)flags:=h.flags&^(iterator|oldIterator)ifh.flags&iterator!=0{flags|=oldIterator}// 更新 hmap 结构
h.B+=biggerh.flags=flagsh.oldbuckets=oldbucketsh.buckets=newbucketsh.nevacuate=0h.noverflow=0// 设置溢出桶
ifh.extra!=nil&&h.extra.overflow!=nil{// Promote current overflow buckets to the old generation.
ifh.extra.oldoverflow!=nil{throw("oldoverflow is not nil")}h.extra.oldoverflow=h.extra.overflowh.extra.overflow=nil}ifnextOverflow!=nil{ifh.extra==nil{h.extra=new(mapextra)}h.extra.nextOverflow=nextOverflow}// the actual copying of the hash table data is done incrementally
// by growWork() and evacuate().
}