mirror of
https://github.com/golang/go
synced 2024-11-15 09:30:33 -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:
parent
c8ba37cf37
commit
f12183ff6a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user