Commit 34808787 authored by Rémy Oudompheng's avatar Rémy Oudompheng

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
parent 4e0749a4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment