From: Rémy Oudompheng Date: Wed, 13 Jun 2012 20:24:28 +0000 (-0400) Subject: [release-branch.go1] runtime: do not unset the special bit after finalization. X-Git-Tag: go1.0.2~44 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f12183ff6aa3aaa8581e1d1a24735a523ac8ac97;p=gostls13.git [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 »»» --- 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;