代码里写了:
NOTE: packing all the keys together and then all the elems together makes the code a bit more complicated than alternating key/elem/key/elem/... but it allows us to eliminate padding which would be needed for, e.g., map[int64]int8.
码农已经很少了,Go的码农更少,上十大是做梦。除非你天天在版上发积分。
【 在 Badluck 的大作中提到: 】
: golang的map底层bucket数据结构是个bmap,他包括tophash、topbits、keys、elems、overflow等字段。
: 但是实际上bmap的结构体定义只有tophash,其他字段都是通过反射填充的。
: 之前hmap是一个确定的结构体,但是现在看也要弄成和bmap一样通过反射编码了。(没仔细翻具体是哪个版本变成这样的)。
: ...................
--
FROM 220.181.41.*