]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: note the double-releasem isn't an error.
authorKeith Randall <khr@golang.org>
Mon, 8 Sep 2014 22:42:48 +0000 (15:42 -0700)
committerKeith Randall <khr@golang.org>
Mon, 8 Sep 2014 22:42:48 +0000 (15:42 -0700)
LGTM=bradfitz
R=dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/136390043

src/runtime/malloc.go

index b3c9c1fd7834a3df44eaba65fa5596f7eacdcc89..8181312f170e9d9f6cbd725bd3ed42e332afbc30 100644 (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)
        }