Commit 83445fdc authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: use persistentalloc instead of mallocgc in symtab

Reduces heap size.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140043
parent 99922aba
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment