mirror of
https://github.com/golang/go
synced 2024-11-12 04:30:22 -07:00
runtime: use persistentalloc instead of SysAlloc in GC
Especially important for Windows because it reserves VM only in multiple of 64k. R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/10082048
This commit is contained in:
parent
b36f2db12a
commit
99922aba8b
@ -1604,9 +1604,7 @@ handlespecial(byte *p, uintptr size)
|
||||
runtime·lock(&finlock);
|
||||
if(finq == nil || finq->cnt == finq->cap) {
|
||||
if(finc == nil) {
|
||||
finc = runtime·SysAlloc(PageSize);
|
||||
if(finc == nil)
|
||||
runtime·throw("runtime: cannot allocate memory");
|
||||
finc = runtime·persistentalloc(PageSize, 0);
|
||||
finc->cap = (PageSize - sizeof(FinBlock)) / sizeof(Finalizer) + 1;
|
||||
finc->alllink = allfin;
|
||||
allfin = finc;
|
||||
|
Loading…
Reference in New Issue
Block a user