Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: clearMarkedNonAtomic different than clearMarked #18941

zhaozhiqianghw opened this issue Feb 4, 2017 · 2 comments


None yet
5 participants
Copy link

commented Feb 4, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?


What operating system and processor architecture are you using (go env)?

linux amd64

The function clearMarked and clearMarkedNonAtomic are defined:
func (m markBits) clearMarked() {
atomic.And8(m.bytep, ^m.mask)

func (m markBits) clearMarkedNonAtomic() {
*m.bytep ^= m.mask

From the definition, these two functions have different meaning,
*m.bytep ^= m.mask
should changed to
*m.bytep &^= m.mask

Although, clearMarkedNonAtomic never be used.

@bradfitz bradfitz added this to the Go1.9 milestone Feb 4, 2017

@bradfitz bradfitz changed the title runtime/mbitmap.go: clearMarkedNonAtomic different with clearMarked runtime: clearMarkedNonAtomic different than clearMarked Feb 4, 2017


This comment has been minimized.

Copy link

commented Feb 4, 2017

Let's just remove markBits.clearMarkedNonAtomic, since, as you say, it has never been used.


This comment has been minimized.

Copy link

commented Feb 4, 2017

CL mentions this issue.

@gopherbot gopherbot closed this in 6aee6b8 Feb 6, 2017

@golang golang locked and limited conversation to collaborators Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.