golang-design / under-the-hood

📚 Go: Under The Hood | Go 语言原本 | https://golang.design/under-the-hood
https://golang.design/under-the-hood
MIT License
4.32k stars 502 forks source link

Yuasa 屏障的图画得是不是有问题? #79

Open cuglaiyp opened 3 years ago

cuglaiyp commented 3 years ago

C.ref2 -> A,那么 shade(*slot)也就是shade(A),应该是把A着色为灰色,为什么图中是把A置为白色、C置为灰色了?

func YuasaWritePointer(slot *unsafe.Pointer, ptr unsafe.Pointer) {
    shade(*slot)
    *slot = ptr
}

image

ps:还是同一个图,这个地方地方的文字和图不匹配,应该是YuasaWritePointer(C.ref3, B)吧 image

changkun commented 3 years ago

是的 这是一个已知错误 确实图是错的 PR welcome