上卷 程序设计
中卷 标准库
- bufio 1.18
- bytes 1.18
- io 1.18
- container 1.18
- encoding 1.18
- crypto 1.18
- hash 1.18
- index 1.18
- sort 1.18
- context 1.18
- database 1.18
- connection
- query
- queryrow
- exec
- prepare
- transaction
- scan & null
- context
- tcp
- udp
- http
- server
- handler
- client
- h2、tls
- url
- rpc
- exec
- signal
- embed 1.18
- plugin 1.18
- reflect 1.18
- runtime 1.18
- KeepAlived
- ReadMemStats
- SetFinalizer
- Stack
- sync 1.18
- atomic
- mutex
- rwmutex
- waitgroup
- cond
- once
- map
- pool
- copycheck
- nocopy
- unsafe 1.18
- fmt 1.18
- log 1.18
- math 1.18
- time 1.18
- timer
下卷 运行时
源码剖析
附录
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
2.2 结构
+-----------------+ +------------+ | mheap | | pageAlloc | +-----------------+ +------------+ | alloc | | alloc | +-----------------+ +------------+ {OS memory} | allocSpan | ---+ | free | ^ +-----------------+ | +------------+ | | grow | | | grow | | +-----------------+ +-- h.pages --> +------------+ +--------+---------+ | freeSpan | | | sysGrow -|---> | sysMap | sysUsed | +-----------------+ | +------------+ +--------+---------+ | freeSpanLocked | ---+ +-----------------+ | sysAlloc | +-----------------+ <-----------------------+ | | +----------+ | +----------------+ +-----> | zerobase | | | mcentral | +-----------+ | +----------+ + <--------- +----------------+ | newobject | | ^ | cacheSpan | +-----------+ | | +----------------+ | mallocgc -|----+ | | uncacheSpan | +-----------+ | +----------> +----------------+ | | | grow | | | +----------------+ | +------------------+ | +-----> | mcache | | +------------------+ v | allocLarge | +----------------+ +------------------+ | sweepLocked | | nextFree -|----+ +----------------+ +------------------+ | | sweep | | refill | | +----------------+ +-------------------+ +------------------+ | | | gcMarkTermination | ---> | prepareForSweep | | | +-------------------+ +------------------+ | v | releaseAll | | +----------------+ +------------------+ | | mspan | | +----------------+ +---> | nextFreeIndex | +----------------+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论