]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use persistentalloc instead of mallocgc for itab
authorDmitriy Vyukov <dvyukov@google.com>
Sun, 9 Jun 2013 17:58:35 +0000 (21:58 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Sun, 9 Jun 2013 17:58:35 +0000 (21:58 +0400)
Reduces heap size.

R=golang-dev, remyoudompheng, bradfitz
CC=golang-dev
https://golang.org/cl/10139043

src/pkg/runtime/iface.c
src/pkg/runtime/runtime.h

index 5973d6d03c5652bc6c42de4d817b55996ad20add..58d17d87ddde90c6511043482ea375b4a6c2b4cc 100644 (file)
@@ -85,7 +85,7 @@ itab(InterfaceType *inter, Type *type, int32 canfail)
        }
 
        ni = inter->mhdr.len;
-       m = runtimeĀ·malloc(sizeof(*m) + ni*sizeof m->fun[0]);
+       m = runtimeĀ·persistentalloc(sizeof(*m) + ni*sizeof m->fun[0], 0);
        m->inter = inter;
        m->type = type;
 
index e616990ccf2eebe8327634fa8ef5e60490727cb1..564493511bae806f363caa56951241ae313eea65 100644 (file)
@@ -418,6 +418,7 @@ struct      Func
 };
 
 // layout of Itab known to compilers
+// allocated in non-garbage-collected memory
 struct Itab
 {
        InterfaceType*  inter;