From: Dmitriy Vyukov Date: Mon, 10 Jun 2013 05:17:46 +0000 (+0400) Subject: runtime: use persistentalloc instead of mallocgc in symtab X-Git-Tag: go1.2rc2~1296 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=83445fdcc3639fc102c11aa1820d592a8615cc86;p=gostls13.git runtime: use persistentalloc instead of mallocgc in symtab Reduces heap size. R=golang-dev, khr CC=golang-dev https://golang.org/cl/10140043 --- 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) {