1
0
mirror of https://github.com/golang/go synced 2024-11-15 11:40:35 -07:00

[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

»»»
This commit is contained in:
Rémy Oudompheng 2012-06-13 16:24:28 -04:00
parent c8ba37cf37
commit f12183ff6a
2 changed files with 1 additions and 3 deletions

View 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;
}

View 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;