1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:08:37 -07:00

runtime: use persistentalloc instead of mallocgc in symtab

Reduces heap size.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140043
This commit is contained in:
Dmitriy Vyukov 2013-06-10 09:17:46 +04:00
parent 99922aba8b
commit 83445fdcc3

View 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) {