]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use persistentalloc instead of SysAlloc in GC
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 10 Jun 2013 05:16:06 +0000 (09:16 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 10 Jun 2013 05:16:06 +0000 (09:16 +0400)
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

index 4a386d16b38c2fcc70f191afb6d457c2cedd040b..547ed9502c4902773ad9d59094253d79f6ab482d 100644 (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;