]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: do not unset the special bit after finalization.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 30 May 2012 06:04:11 +0000 (08:04 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 30 May 2012 06:04:11 +0000 (08:04 +0200)
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 d718b5aea96689dd1548f8ca5912635ecb2b10d1..5fde535a5e34527f3394db372fcc17e13768018b 100644 (file)
@@ -1042,7 +1042,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;