1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:20:11 -07:00

runtime: note the double-releasem isn't an error.

LGTM=bradfitz
R=dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/136390043
This commit is contained in:
Keith Randall 2014-09-08 15:42:48 -07:00
parent 1fadd9e1ae
commit 1d88f9dd4d

View File

@ -134,6 +134,8 @@ func gomallocgc(size uintptr, typ *_type, flags int) unsafe.Pointer {
if mp.curg != nil {
mp.curg.stackguard0 = mp.curg.stackguard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.
releasem(mp)
releasem(mp)
}
@ -309,6 +311,8 @@ marked:
if mp.curg != nil {
mp.curg.stackguard0 = mp.curg.stackguard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.
releasem(mp)
releasem(mp)
}