From b36f2db12a3b12ef1a9134ac070bb7571dcf84f9 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Sun, 9 Jun 2013 21:58:35 +0400 Subject: [PATCH] runtime: use persistentalloc instead of mallocgc for itab Reduces heap size. R=golang-dev, remyoudompheng, bradfitz CC=golang-dev https://golang.org/cl/10139043 --- src/pkg/runtime/iface.c | 2 +- src/pkg/runtime/runtime.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/iface.c b/src/pkg/runtime/iface.c index 5973d6d03c5..58d17d87ddd 100644 --- a/src/pkg/runtime/iface.c +++ b/src/pkg/runtime/iface.c @@ -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; diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index e616990ccf2..564493511ba 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -418,6 +418,7 @@ struct Func }; // layout of Itab known to compilers +// allocated in non-garbage-collected memory struct Itab { InterfaceType* inter;