mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: check for preemption due to garbage collection
in various already expensive routines. helps keep cpu utilization up when GOMAXPROCS > 1, but not a full solution. http://groups.google.com/group/golang-nuts/t/7a9535c4136d3e2 R=r CC=golang-dev https://golang.org/cl/184043
This commit is contained in:
parent
752b1702d0
commit
5328df6534
6 changed files with 29 additions and 2 deletions
|
|
@ -27,10 +27,11 @@ mallocgc(uintptr size, uint32 refflag, int32 dogc)
|
|||
void *v;
|
||||
uint32 *ref;
|
||||
|
||||
if(gcwaiting && g != m->g0)
|
||||
gosched();
|
||||
if(m->mallocing)
|
||||
throw("malloc/free - deadlock");
|
||||
m->mallocing = 1;
|
||||
|
||||
if(size == 0)
|
||||
size = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue