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

Closed
zhaozhiqianghw opened this issue Feb 4, 2017 · 2 comments
Closed

runtime: clearMarkedNonAtomic different than clearMarked #18941

zhaozhiqianghw opened this issue Feb 4, 2017 · 2 comments
Milestone

Comments

@zhaozhiqianghw
Copy link

Please answer these questions before submitting your issue. Thanks!

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

1.7.4

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
@ianlancetaylor
Copy link
Contributor

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

@gopherbot
Copy link

CL https://golang.org/cl/36322 mentions this issue.

@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.
Projects
None yet
Development

No branches or pull requests

5 participants