From 83445fdcc3639fc102c11aa1820d592a8615cc86 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 10 Jun 2013 09:17:46 +0400 Subject: [PATCH] runtime: use persistentalloc instead of mallocgc in symtab Reduces heap size. R=golang-dev, khr CC=golang-dev https://golang.org/cl/10140043 --- src/pkg/runtime/symtab.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pkg/runtime/symtab.c b/src/pkg/runtime/symtab.c index 461707b98e..9fa2ac3db4 100644 --- a/src/pkg/runtime/symtab.c +++ b/src/pkg/runtime/symtab.c @@ -228,13 +228,12 @@ dofunc(Sym *sym) else if(runtime·strcmp(sym->name, (byte*)".args") == 0) func[nfunc-1].args = sym->value; else if(runtime·strcmp(sym->name, (byte*)".nptrs") == 0) { - // TODO(cshapiro): use a dense representation for gc information if(sym->value != func[nfunc-1].args/sizeof(uintptr)) { runtime·printf("runtime: pointer map size and argument size disagree\n"); runtime·throw("mangled symbol table"); } cap = ROUND(sym->value, 32) / 32; - func[nfunc-1].ptrs.array = runtime·mallocgc(cap*sizeof(uint32), FlagNoPointers|FlagNoGC, 0, 1); + func[nfunc-1].ptrs.array = runtime·persistentalloc(cap*sizeof(uint32), sizeof(uint32)); func[nfunc-1].ptrs.len = 0; func[nfunc-1].ptrs.cap = cap; } else if(runtime·strcmp(sym->name, (byte*)".ptrs") == 0) { -- 2.48.1