From f12183ff6aa3aaa8581e1d1a24735a523ac8ac97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Oudompheng?= Date: Wed, 13 Jun 2012 16:24:28 -0400 Subject: [PATCH] [release-branch.go1] runtime: do not unset the special bit after finalization. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ««« 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 »»» --- src/pkg/runtime/mfinal.c | 3 +-- src/pkg/runtime/mgc0.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pkg/runtime/mfinal.c b/src/pkg/runtime/mfinal.c index c6f2b54219f..1fa5ea401d4 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 e043864c19e..e8fb266f483 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;