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) ...@@ -1604,9 +1604,7 @@ handlespecial(byte *p, uintptr size)
runtime·lock(&finlock); runtime·lock(&finlock);
if(finq == nil || finq->cnt == finq->cap) { if(finq == nil || finq->cnt == finq->cap) {
if(finc == nil) { if(finc == nil) {
finc = runtime·SysAlloc(PageSize); finc = runtime·persistentalloc(PageSize, 0);
if(finc == nil)
runtime·throw("runtime: cannot allocate memory");
finc->cap = (PageSize - sizeof(FinBlock)) / sizeof(Finalizer) + 1; finc->cap = (PageSize - sizeof(FinBlock)) / sizeof(Finalizer) + 1;
finc->alllink = allfin; finc->alllink = allfin;
allfin = finc; 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