From 99922aba8bca811f28f0d8e7beed4a0801a82c1c Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 10 Jun 2013 09:16:06 +0400 Subject: [PATCH] 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 --- src/pkg/runtime/mgc0.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 4a386d16b3..547ed9502c 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -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;