diff options
author | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2012-06-13 16:24:28 -0400 |
---|---|---|
committer | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2012-06-13 16:24:28 -0400 |
commit | f12183ff6aa3aaa8581e1d1a24735a523ac8ac97 (patch) | |
tree | bfbfc9e45200826b5484497fd8abc1d9a93c5900 | |
parent | c8ba37cf377497e73d3d924b06505db63b906fe7 (diff) | |
download | go-f12183ff6aa3aaa8581e1d1a24735a523ac8ac97.tar.gz go-f12183ff6aa3aaa8581e1d1a24735a523ac8ac97.zip |
[release-branch.go1] runtime: do not unset the special bit after finalization.
««« backport 4a10c887bb3e
runtime: do not unset the special bit after finalization.
A block with finalizer might also be profiled. The special bit
is needed to unregister the block from the profile. It will be
unset only when the block is freed.
Fixes #3668.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6249066
»»»
-rw-r--r-- | src/pkg/runtime/mfinal.c | 3 | ||||
-rw-r--r-- | src/pkg/runtime/mgc0.c | 1 |
2 files changed, 1 insertions, 3 deletions
diff --git a/src/pkg/runtime/mfinal.c b/src/pkg/runtime/mfinal.c index c6f2b54219..1fa5ea401d 100644 --- a/src/pkg/runtime/mfinal.c +++ b/src/pkg/runtime/mfinal.c @@ -150,8 +150,7 @@ runtime·addfinalizer(void *p, void (*f)(void*), int32 nret) tab = TAB(p); runtime·lock(tab); if(f == nil) { - if(lookfintab(tab, p, true, nil)) - runtime·setblockspecial(p, false); + lookfintab(tab, p, true, nil); runtime·unlock(tab); return true; } diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index e043864c19..e8fb266f48 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1066,7 +1066,6 @@ runfinq(void) framecap = framesz; } *(void**)frame = f->arg; - runtime·setblockspecial(f->arg, false); reflect·call((byte*)f->fn, frame, sizeof(uintptr) + f->nret); f->fn = nil; f->arg = nil; |