]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use persistentalloc instead of mallocgc in symtab
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 10 Jun 2013 05:17:46 +0000 (09:17 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 10 Jun 2013 05:17:46 +0000 (09:17 +0400)
Reduces heap size.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140043

src/pkg/runtime/symtab.c

index 461707b98ed1ca40377ca602d73604c6109a773e..9fa2ac3db418bb02bcc3ea809a9169c3fac54fc9 100644 (file)
@@ -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) {