mirror of https://github.com/golang/go.git
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
4e0749a478
commit
348087877c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue