1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:56:47 -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:
Dmitriy Vyukov 2013-06-10 09:16:06 +04:00
parent b36f2db12a
commit 99922aba8b

View File

@ -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;