Commit 99922aba authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent b36f2db1
......@@ -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;
......
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