]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] runtime: do not unset the special bit after finalization.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 13 Jun 2012 20:24:28 +0000 (16:24 -0400)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 13 Jun 2012 20:24:28 +0000 (16:24 -0400)
««« 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
src/pkg/runtime/mgc0.c

index c6f2b54219ffe9c258424883ec3486c2d589a757..1fa5ea401d42031ecb5cd085b1a95fd0c28300dd 100644 (file)
@@ -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;
        }
index e043864c19e49d0a2c6948c5a546a7e7bb4daf50..e8fb266f4834fbf544657bc83627457788403de0 100644 (file)
@@ -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;