]> Cypherpunks repositories - gostls13.git/commit
runtime: update docs, code for SetFinalizer
authorRuss Cox <rsc@golang.org>
Mon, 6 Oct 2014 18:18:09 +0000 (14:18 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 6 Oct 2014 18:18:09 +0000 (14:18 -0400)
commit9a5b055b95c6719083f32c1f8089725a0a890425
treef672cc387c79f77706bd22e4e6d7e0c4cd9edf52
parent609d996fac7f68b34032572b7bde627f658b95f2
runtime: update docs, code for SetFinalizer

At last minute before 1.3 we relaxed SetFinalizer to avoid
crashes when you pass the result of a global alloc to it.
This avoids the crash but makes SetFinalizer a bit too relaxed.

Document that the finalizer of a global allocation may not run.

Tighten the SetFinalizer check to ignore a global allocation but
not ignore everything else.

Fixes #7656.

LGTM=r, iant
R=golang-codereviews, iant, r
CC=dvyukov, golang-codereviews, khr, rlh
https://golang.org/cl/145930043
src/runtime/malloc.go
src/runtime/mfinal_test.go